View Source Squeeze.Social (OpenPace v0.0.1)
The Social context.
Link to this section Summary
Functions
Follows a user.
Returns the list of follows.
Returns the list of follows.
Unfollows a user.
Link to this section Functions
Follows a user.
follow_user(Alice, Bob) # Alice follows Bob
- Create a follow with follower == Alice and followee == Bob
- Increment Bob's follower_count
- Increment Alice's following_count
examples
Examples
iex> follow_user(user1, user2)
{:ok, %User{}}
Returns the list of follows.
examples
Examples
iex> list_followers(user)
[%User{}, ...]
Returns the list of follows.
examples
Examples
iex> list_following(user) [%User{}, ...]
Unfollows a user.
unfollow_user(Alice, Bob) # Alice unfollows Bob
- Delete the follow with follower == Alice and followee == Bob
- Decrement Bob's follower_count
- Decrement Alice's following_count
examples
Examples
iex> unfollow_user(user1, user2)
{:ok, %Follow{}}