friendship = Friendship.new
friendship.befriender = current_user
friendship.befriendee = @new_friend
friendship = Friendship.new
friendship.befriender = current_user
friendship.befriendee = @new_friend
flash.now[:error] = t "friendships.make_friend.limit_exceeded"
elsif friendship.save
flash[:notice] = t "friendships.make_friend.success", :name => @new_friend.display_name
flash.now[:error] = t "friendships.make_friend.limit_exceeded"
elsif friendship.save
flash[:notice] = t "friendships.make_friend.success", :name => @new_friend.display_name
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