We've been trying to treat Friendship as a unified single model. This is starting to break down as be build more Friendship-related functionality. Friendships are bi-directional. Each person has a different feeling about the other person, and those feelings could be aligned and reciprocated, but they aren't necessarily.
Instead of trying to enforce that both people feel the same way about each other, and querying friend and buddy, this refactor will create a system where there are up to two friendship objects in a relationship between two profiles. One that describes how Profile A feels about Profile B, and one that describe how Profile B feels about Profile A. This will help when it comes to querying whether a profile has access to another profile's events, and whether a profile is interested in another Profile's events.
Migration to rename buddy_id to profile_id and update the index
Update all references to Friends
Factory
Policy
Seeds
Controllers/Models
FriendshipPolicy scope updated to reflect the new relationship
Decisions
Instead of using "Accepted", use "Friendly" - The new Friendship model isn't based around the idea of a request, and it reflects a one-way feeling which could be reciprocated or not. "Friendly" is a good way to describe the idea that you might want to hang out with someone and grab lunch if they're going to the same conference as you.
Renaming buddy_id to profile_id can be a separate PR.
The UI around friendship needs to change a lot. We now need to describe bi-directional relationships instead of assuming they're the same. This is going to require quite a few components change. For this PR, let's scope back, and cut out any information about how they feel about you.
We've been trying to treat Friendship as a unified single model. This is starting to break down as be build more Friendship-related functionality. Friendships are bi-directional. Each person has a different feeling about the other person, and those feelings could be aligned and reciprocated, but they aren't necessarily.
Instead of trying to enforce that both people feel the same way about each other, and querying friend and buddy, this refactor will create a system where there are up to two friendship objects in a relationship between two profiles. One that describes how Profile A feels about Profile B, and one that describe how Profile B feels about Profile A. This will help when it comes to querying whether a profile has access to another profile's events, and whether a profile is interested in another Profile's events.
Decisions