On Apr 20, 2010, at 9:42 PM, Pratik <pratikn...@gmail.com> wrote:

I suppose you could override Relation#build_where

   def build_where(*args)
     if result = super
       case args.first
       when Hash
         # Figure out table names from *args here and add them to
join_values or something
       else
         super
       end
     end
   end

I'm not very sure about the feature itself though. There are times
when you may want to eager load the joined table.


Thanks for the feedback, Pratik. That's actually where I plugged in to do it in the linked github repo, but I sort of piggybacked on joindependency a bit to do the heavy lifting.


--
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 rubyonrails-c...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to