I'm working on a plug-in that will allow has_many associations to
ignore the foreign key. This may sound silly, but there are situations
where you'd like to join on something other than a single foreign key.
Right now, I can configure :conditions for the association, but these
are in addition to the existing foreign key.
My plug-in would do something akin to http://pastie.org/319143. This
is really just pseudo-code, I haven't tested it yet.
So, two questions:
- Am I the only one crazy enough to think something like this is
- How can a plugin monkey-patch ActiveRecord for this? Just override
the entire construct_sql method?
Thanks for any advice,