Mackenzie-Frey / brownfield-of-dreams

Brownfield of Dreams is a video tutorial platform in which additional functionality was built on an existing codebase.
https://brownfield-dreams.herokuapp.com/
1 stars 0 forks source link

Friendships Patch #31

Closed Mackenzie-Frey closed 5 years ago

Mackenzie-Frey commented 5 years ago

Fixes Authenticity Token error and adds logic to only show the Add Friend button if the users are not already friends. Passes all test and visible on localhost.

The Follower methods of get_user_id and not_a_friend?(current_user_id) are used in combination to check if the users are already friends. Ideally, these would be one call to the database, instead of two. I choose to make them two in order to meet the project deadline, as making them into one query was significantly increasing the developer time to write the query. I added these methods as a topic for refactoring to the -refactor card-.