app/models/user.rb
def feed
    following_ids = "SELECT followed_id FROM relationships
                    WHERE follower_id = :user_id"
    Micropost.where("user_id IN (#{following_ids})
                    OR user_id = :user_id", user_id: id)
  end
# Defines a 'feed' of microposts
Defines a 'feed' of microposts
Defines a ' feed ' of microposts
def feed
    following_ids = "SELECT followed_id FROM relationships
                    WHERE follower_id = :user_id"
    Micropost.where("user_id IN (#{following_ids})
                    OR user_id = :user_id", user_id: id)
  end
def feed following_ids = "SELECT followed_id FROM relationships
                    WHERE follower_id = :user_id" Micropost . where ( "user_id IN (#{following_ids})
                    OR user_id = :user_id" , user_id : id ) end
Defines a 'feed' of microposts
Defines a ' feed ' of microposts