In my plugin for specifying custom finder SQL for eager-loading of
associations ( http://rubyforge.org/projects/eagerfindersql ), I
needed to work hard to avoid not completely re-implementing each
associated class. I needed to pass extra options in
ActiveRecord::Associations::find_with_assocations down into private
subclasses: ActiveRecord::Associations::JoinDependency and JoinBase.

To keep from having to redefine the initializer for each of these
classes, I ended up using a thread variable to hold the mapping data
structures needed to assign results from the query to different
associations. Not an ideal solution, but it did solve the problem with
minimal overriding of methods within these classes.

Gregg Kellogg
www.kellogg-assoc.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to