Is there a way to change LEFT JOIN key for :include ? I mean when I use :include to add LEFT JOIN to the query it adds to the ON clause: table2.[foreign_key_from_model_of_table1] = table1.[primary_key_of_table1] but I need foreign key from table2 model instead of primary_key_of_table1 so ON will look like: table2.[foreign_key_from_model_of_table1] = table1.[foreign_key_from_model_of_table2] Is this possible to do without raw SQL? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---