I have 3 models
I need to find all comments made by people that a user is following,
which in effect is this simple SQL query:
from comments, followings, users
where users.id = followings.follower_id
and followings.user_id = comments.user_id
and users.id = 1
Can someone help? I tried this but it didn't work:
class User ...
class Following ...
has_many :comments, :foreign_key => 'user_id'
User.find(:first).followings (this works)
Following.find(:first).comments (this works)
User.find(:first).followings.comments (this does NOT work)