Closed michelson closed 6 years ago
BTW, this started to happen from rails 5.0.0 to latest rails 5.1.4
This is fixed in 6.0.0
Hi @seuros , I'm sorry but I'm afraid that this issue is still happening:
pry(#<RSpec::ExampleGroups::Applicant::Applicant::Defaults>)> applicant.reload.user.reload.profile.professions.size
TypeError: Hash can't be coerced into Fixnum
from /Users/michelson/.rvm/gems/ruby-2.3.1/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:219:in `+'
[3] pry(#<RSpec::ExampleGroups::Applicant::Applicant::Defaults>)> applicant.reload.user.reload.profile.professions.count
=> {3=>1}
[4] pry(#<RSpec::ExampleGroups::Applicant::Applicant::Defaults>)> ActsAsTaggableOn
=> ActsAsTaggableOn
[5] pry(#<RSpec::ExampleGroups::Applicant::Applicant::Defaults>)> ActsAsTaggableOn::VERSION
=> "6.0.1"
Any update on this issue ? This is happening in Rails 6.0.2.1
also
Hi , I'm upgrading an app to rails 5 and I've found that AATO is returning a hash on
count
method onActsAsTaggableOn::Tag::ActiveRecord_Associations_CollectionProxy
. This raises an error when try to get thesize
of the collection.example:
$irb> Profile.first.professions.size
this is because the
count_records
method called from/active_record/associations/collection_association.rb:216
is somehow overwritten and is returning a hash{1:1}
any hints on how do you extend the count on the association collection ?
best