I assume this is your requirement. Allow A to add B as a friend if:
- A and B are not already friends AND
- A and B are not the same person
So, in pseudo-code, unless (already_friends or same_person) allow_add_friend end
If this is your requirement, your statement should read:
unless Relationship.are_friends?(current_user, @user) or (current_user == @user)
Note that &&
changed to or
and !=
changed to ==
.