This example –
– shows how to pass a parameter to an extended association; Ie: books =
Is there ANY way to do this with a dynamic variable in combination with
active eager loading? Ie: This works: “p.fgp.by_fg(9)”, but this does
not: “p = Proposal.find(317, :include => :fgp.by_fg(9))”, giving
“NoMethodError: undefined method `by_fg’ for :fgp:Symbol” when used with
All I’m after is having AR’s eager loading joins contrain the joined
tables at the join rather than the where clause. Ie: “LEFT OUTTER JOIN
fgp ON … AND fgp.id_fg = 9”
I can’t find any way to accomplish this outside find_by_sql or :joins,
and I’d very much like to retain the resulting object composition AR
gives when using :include.
Thanks and best to everyone. Rails is great!