AssociationProxy#conditions is not callable
Reported by Tomoaki Hayasaka | September 27th, 2010 @ 04:20 PM | in Hobo 1.3 (Rails 3)
I use Hobo 1.3pre6 + Rails 3.0.
On plain Rails 3.0, AssociationProxy#conditions works as expected:
irb(main):001:0> Task.new.users.respond_to? :conditions
=> true
irb(main):002:0> Task.new.users.conditions
=> nil
But with hobo 1.3pre6 gem loaded, AssociationProxy#conditions is not callable:
irb(main):001:0> Task.new.users.respond_to? :conditions
=> true
irb(main):002:0> Task.new.users.conditions
NoMethodError: undefined method `conditions' for #<Class:0xb097e04>
from /var/lib/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/base.rb:1016:in `method_missing'
from /home/hayasaka/work/hobo/hobo/hobo/lib/hobo/model.rb:310:in `method_missing'
from /var/lib/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:443:in `block in method_missing'
from /var/lib/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/base.rb:1128:in `with_scope'
from /var/lib/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/associations/association_proxy.rb:203:in `with_scope'
from /var/lib/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:439:in `method_missing'
from (irb):2
from /var/lib/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands/console.rb:44:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands/console.rb:8:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):003:0>
Hobo::Model::AccessibleAssociations and rapid_forms depend on AssociationProxy#conditions and they are not usable.
Comments and changes to this ticket
-
Domizio Demichelis October 2nd, 2010 @ 12:40 PM
- State changed from new to invalid
-
Tom Locke October 4th, 2010 @ 05:01 PM
- State changed from invalid to open
(from [db652876290ac22f734fa50fbd93ead6257f37e6]) association.conditions is a private method [#804 state:open] [#798 state:open] http://github.com/tablatom/hobo/commit/db652876290ac22f734fa50fbd93...
-
Domizio Demichelis October 4th, 2010 @ 05:06 PM
- Milestone set to Hobo 1.3 (Rails 3)
- Assigned user set to Domizio Demichelis
- Milestone order changed from 197895 to 0
Why the previous update is marked as a Tom's message? I did the commit and changed the state from the commit message. hmmmm
Anyway, I changed the calls to .conditions to .send(:conditions) so we can avoid the patch. Please check if it is working, so I can mark it as resolved. Thank you.
-
Domizio Demichelis October 4th, 2010 @ 10:00 PM
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
- 798 join table access broken in 1.3. worked in 1.0 see #804
- 798 join table access broken in 1.3. worked in 1.0 (from [db652876290ac22f734fa50fbd93ead6257f37e6]) associa...
- 804 AssociationProxy#conditions is not callable (from [db652876290ac22f734fa50fbd93ead6257f37e6]) associa...