Skip to content

Removing and blocking friendships

raw1z edited this page Mar 6, 2012 · 1 revision

Removing friendships

The remove_friendship() method allow a user to remove its friendships :

@john.remove_friendship @jane
@john.remove_friendship @peter
@john.remove_friendship @victoria

Blocking friendships

The block() method allow a user to block a friendship with another user :

@john.invite @jane
@jane.block @john

To get the blocked users :

@jane.blocked #=> [@john]

You can also check if a user is blocked :

@jane.blocked? @john #=> true

Unblocking friendship

The unblock() method allow a user to unblock previously blocked friendship with another user :

@jane.block @john
@jane.blocked #=> [@john]

@jane.unblock @john
@jane.blocked #=> []