I like to create named areas for rails. however, I came across a bit of pickle. Ive got a fairly convenient use of these areas for such associations:
named_scope :foo, :joins => :bar, :conditions => "bar_attribute = 'something'"
Now, let's pretend that I have a baz table that contains the foreign key from the table. I need something like this:
named_scope :foo, :joins => (:bar => :baz), :conditions => "bar.id = baz.bar_id AND baz_attribute = 'something_else'"
How is this possible?
thanks
source
share