undefined method `conditions' for BelongsToAssociation
Reported by Arnaud D. | March 26th, 2012 @ 11:21 AM
Hi,
In Edge hobo 1.4, I encounter this issue coming from accessible associations.rb :
undefined method conditions' for
#<ActiveRecord::Associations::BelongsToAssociation:0x124f7484>
/home/arnaud/.rvm/gems/ree-1.8.7-2012.02/bundler/gems/hobo-7002574fbd1a/hobo/lib/hobo/model/accessible_associations.rb:94:in
send'
/home/arnaud/.rvm/gems/ree-1.8.7-2012.02/bundler/gems/hobo-7002574fbd1a/hobo/lib/hobo/model/accessible_associations.rb:94:in
finder_for_belongs_to'
/home/arnaud/.rvm/gems/ree-1.8.7-2012.02/bundler/gems/hobo-7002574fbd1a/hobo/lib/hobo/model/accessible_associations.rb:131:in
wording='
activerecord (3.1.4) lib/active_record/base.rb:1751:in `send'
I think this issue comes from the fact I use :conditions on a belongs_to association.
The error comes from this line in accessible associations.rb
:
conditions =
ActiveRecord::Associations::BelongsToAssociation.new(record,
refl).send(:conditions)
should be replaced by
conditions =
ActiveRecord::Associations::BelongsToAssociation.new(record,
refl).options[:conditions]
and afterwards, this works well.
as it's done in select-one tag.
Arnaud.
No comments found
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »