Open LittleBigProgramming opened 2 years ago
@ChaelCodes Do you have a convention for moving methods out of controllers? Or are you happy for me to move this check into a private method within the controller and call it from there? https://github.com/ChaelCodes/ConfBuddies/pull/116/files#:~:text=if-,Friendship,-.where(buddy_id%3A%20current_user
Description of Feature or Issue
closes #83
ConfBuddies is a fun and playful app. When you accept your first friendship, send a custom message. "It's dangerous to go alone, take this Friend."
Added conditional within the update method of the friendships_controller to check if there is only 1 friendship with the status of accepted after the
before_action :set_friendship
has been called./spec/requests/friendships_spec.rb
has been updated based on these changes to check the successful notice message depending on the condition.Checklist
User-Facing Changes