Forum: Ruby on Rails Bug (or feature?) in association_proxy: attributes in condit

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ian W. (Guest)
on 2006-03-24 10:11
(Received via mailing list)
Hi List,

When I do something like

    belongs_to :thing, :conditions => 'var = #{my_var}'

method_missing in association_proxy.rb gets recursively called.

Are these bind-style vars not allowed?  Given the code in the
conditions method of association_proxy.rb, it looks lilke they're
meant to be.

I'm running -v 4021 of rails.

Cheers,
Ian
Ian W. (Guest)
on 2006-03-24 10:30
(Received via mailing list)
Update to the above

>     belongs_to :thing, :conditions => 'var = #{my_var}'
This works in rails 1.0, suggesting a bug has been introduced
somewhere along the line

Cheers,
Ian
This topic is locked and can not be replied to.