app/models/user.rb
# Defines a proto-feed.
# See "Following users" for the full implementation
Defines a proto-feed.
See "Following users" for the full implementation
Defines a proto - feed . See " Following users " for the full implementation
def feed
    following_ids_subselect = "SELECT followed_id FROM relationships WHERE follower_id = :user_id"
    Micropost.where("user_id IN (#{following_ids_subselect}) OR user_id = :user_id", user_id: id)
  end
def feed following_ids_subselect = "SELECT followed_id FROM relationships WHERE follower_id = :user_id" Micropost . where ( "user_id IN (#{following_ids_subselect}) OR user_id = :user_id" , user_id : id ) end
Defines a proto-feed.
Defines a proto - feed .
#This shit fuckin CONFUSING #The 'where' function issues SQL queries, and the question mark escapes any data that gets inserted. ALWAYS use question mark for SQL queries to avoid SQL Injection attacks.