lib/popular/popular.rb
def unfriend friend
      run_callbacks :unfriend do
        friendships
        .where( friend_type: friend.class.name )
        .where( friend_id: friend.id )
        .first.destroy
      end
    end
def unfriend friend
      run_callbacks :unfriend do
        friendships
        .where( friend_type: friend.class.name )
        .where( friend_id: friend.id )
        .first.destroy
      end
    end
def unfriend friend run_callbacks :unfriend do friendships . where ( friend_type : friend . class . name ) . where ( friend_id : friend . id ) . first . destroy end end
Removes a friend from an instance's friend's list

 @param [Object] friend a popular_model in this instance's friends list

 @example
   user = User.create name: "Justin"
   other_user = User.create name: "Jenny"
   user.befriend other_user
   user.unfriend other_user

   user.friends_with? other_user # => false
Removes a friend from an instance s friend s list