Skip to content
Snippets Groups Projects
Commit e239fc30 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix error when unfollowing somebody who wasn't followed in the first place

parent d0229754
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@ class Account < ActiveRecord::Base
end
def unfollow!(other_account)
self.active_relationships.find_by(target_account: other_account).destroy
follow = self.active_relationships.find_by(target_account: other_account)
follow.destroy unless follow.nil?
end
def following?(other_account)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment