Find question

Hello All,

Quick find question for you, I have a comments, users and a friends
table.

The user model has_many :friends, :through => :friendships

How can I include the friends comments in a find? (I know the below does
not work, it just pulls up the @user’s comments) but if i substitute in
([@user, 4, … It works fine pulling in the @user.id’s comments and the
user who’s ID is 4 in as well.

@comments = Comment.find_all_by_user_id([@user, @user.friends],
:include =>
[:user,:method_type],
:order => “comments.id DESC”,
:limit => “10”)

Thank you in advance,

  • John