#804 ✓resolved
Tomoaki Hayasaka

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

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.

New-ticket Create new ticket

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

Pages