> Gabe, are you talking about eager-loading finds having custom joins > that don't just load along a chain but match-up arbitrary foreign keys? > I and others have written patches for find_by_sql/:finder_sql > that allows them to accept an :include option, instantiating the > object hierarchy from SQL that uses field aliasing of the Rails eager > loading form: > > http://www.kellogg-assoc.com/articles/2006/11/05/eager-finder-sql > http://mrj.bpa.nu/eager_custom_sql_rails_1.2.rb
I think that the feature you've implemented there should probably be rolled in to active record at some point, whether or not that's for 2.0 I'm not sure. However this plugin clearly minimises the need for the custom :symbol[] approach, or is there another case I haven't thought of? > Or are you talking about having eager-loading instantiate the > cross and back links of the object hierarchy? A patch that > implemented the first step of this -- matching and caching not just > the instances seen in each eager-loaded association, but those in > each model class -- was posted here several weeks ago by Fred Cheung. > > A simple eager-loaded object tree is the most common query > required in a Web app, and being able to restrict the attributes > selected can make a huge speed and space difference when unwanted > fields are large and the eager load runs deep. Full bi-directional associations are probably too much to push out for 2.0, but in the long run it'd be nice to get them in there. If finder_sql + :include can cover all the cases here, I think we'd be better off looking to merge that functionality into rails, rather than building some more syntax for a specific place we need it. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
