From c0c279e6d85f90e5f507fde384cbd5abf4d1d6e7 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 14 Dec 2014 21:35:24 +0100 Subject: [PATCH] closes GitHub issue #16 --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 6ef2dff6..78c779ea 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User < ActiveRecord::Base # unfollows an user def unfollow(target_user) - active_relationships.find_by(target: target_user).destroy + relationship = active_relationships.find_by(target: target_user).destroy Notification.denotify target_user, relationship # decrement counts