friendship = Friendship.new
friendship.befriender = current_user
friendship.befriendee = @new_friend
friendship = Friendship.new
friendship.befriender = current_user
friendship.befriendee = @new_friend
elsif friendship.save
flash[:notice] = t "friendships.make_friend.success", :name => @new_friend.display_name
UserMailer.friendship_notification(friendship).deliver_later
elsif friendship.save
flash[:notice] = t "friendships.make_friend.success", :name => @new_friend.display_name
UserMailer.friendship_notification(friendship).deliver_later
Friendship.where(:befriender => current_user, :befriendee => @friend).delete_all
flash[:notice] = t "friendships.remove_friend.success", :name => @friend.display_name
else
flash[:error] = t "friendships.remove_friend.not_a_friend", :name => @friend.display_name
end
Friendship.where(:befriender => current_user, :befriendee => @friend).delete_all
flash[:notice] = t "friendships.remove_friend.success", :name => @friend.display_name
else
flash[:error] = t "friendships.remove_friend.not_a_friend", :name => @friend.display_name
end