I need SQL : SELECT `activities`.* FROM `activities` INNER JOIN `friendships` ON `activities`.user_id = `friendships`.friend_id WHERE `friendships`.user_id = 1
My User Model code: has_many :friendships, :dependent => :destroy has_many :friends, :through => :friendships has_many :activities ############################## has_many :friends_activities, :foreign_key => :user_id, :class_name => 'Activity', :through => :friendships, :source => :friend Rails3 return: ON `activities`.id = `friendships`.friend_id ??! :foreign_key is ignored Why ?!!!! -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.