From d917d13880c8d9340ece38184e6c80fba0c0edb1 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 18 Apr 2013 18:39:54 +0600 Subject: [PATCH] [#42] fix error with remove_member --- app/models/relation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/relation.rb b/app/models/relation.rb index e046545d6..58c54b277 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -34,10 +34,11 @@ class Relation < ActiveRecord::Base def self.remove_member(member, target) return false if target.respond_to?(:owner) && target.owner == member - Relation.by_actor(member).by_target(target).each{|r| r.destroy} + res = Relation.by_actor(member).by_target(target).each{|r| r.destroy} if member.is_a?(User) && ['Project', 'Group'].include?(target.class.name) member.check_assigned_issues target end + res end protected