summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-02 13:03:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-02 13:03:22 +0000
commit5fea79504c7483ce589d2f91adf05760e1ba156f (patch)
tree9e38964bcad523aa170a754bd485ea73a621c5d0 /app/models
parent00481b78c8f508e2faef5b004e8ea5fb560f51ee (diff)
downloadredmine-5fea79504c7483ce589d2f91adf05760e1ba156f.tar.gz
redmine-5fea79504c7483ce589d2f91adf05760e1ba156f.zip
Don't remove watchers on permission change.
This can be far too slow (especially with membership inheritance) and notifications are not sent to watchers that are not allowed to view the item. If we still want to remove watchers that are no longer able to view the watched items, the redmine:watchers:prune task can be called periodically. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11300 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/member.rb11
-rw-r--r--app/models/member_role.rb3
2 files changed, 0 insertions, 14 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 5ff31f316..b11086061 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -27,7 +27,6 @@ class Member < ActiveRecord::Base
validate :validate_role
before_destroy :set_issue_category_nil
- after_destroy :unwatch_from_permission_change
def role
end
@@ -52,7 +51,6 @@ class Member < ActiveRecord::Base
member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)}
if member_roles_to_destroy.any?
member_roles_to_destroy.each(&:destroy)
- unwatch_from_permission_change
end
end
@@ -112,13 +110,4 @@ class Member < ActiveRecord::Base
def validate_role
errors.add_on_empty :role if member_roles.empty? && roles.empty?
end
-
- private
-
- # Unwatch things that the user is no longer allowed to view inside project
- def unwatch_from_permission_change
- if user
- Watcher.prune(:user => user, :project => project)
- end
- end
end
diff --git a/app/models/member_role.rb b/app/models/member_role.rb
index f344696be..29ad6563d 100644
--- a/app/models/member_role.rb
+++ b/app/models/member_role.rb
@@ -66,9 +66,6 @@ class MemberRole < ActiveRecord::Base
def remove_inherited_roles
MemberRole.where(:inherited_from => id).all.group_by(&:member).each do |member, member_roles|
member_roles.each(&:destroy)
- if member && member.user
- Watcher.prune(:user => member.user, :project => member.project)
- end
end
end
end