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
Showing with 2 additions and 1 deletion
+2 -1
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment