I have the following schema.
table: user t.column :id, :integer
table: friends t.column :user_id, :integer #Owner of this friendship t.column :friend_id, :integer #FK to User table
table: activity t.column :user_id
Basically I want to display all activity from friends that i have
I currently have the following has_many finder...
has_many :friend_activities, :class_name => 'Activity', :finder_sql => 'select a.* from activities a, friend f where a.user_id = f.friend_id and f.user_id = #{id}'
Is it even possible to change the above has_many to not user the :finder_sql but using some combination of :through, :source ... ??? If so can someone please help.