[#42] fix error with remove_member

This commit is contained in:
Alexander Machehin 2013-04-18 18:39:54 +06:00
parent c47cd5b792
commit d917d13880
1 changed files with 2 additions and 1 deletions

View File

@ -34,10 +34,11 @@ class Relation < ActiveRecord::Base
def self.remove_member(member, target) def self.remove_member(member, target)
return false if target.respond_to?(:owner) && target.owner == member 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) if member.is_a?(User) && ['Project', 'Group'].include?(target.class.name)
member.check_assigned_issues target member.check_assigned_issues target
end end
res
end end
protected protected