diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-02 13:03:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-02 13:03:22 +0000 |
commit | 5fea79504c7483ce589d2f91adf05760e1ba156f (patch) | |
tree | 9e38964bcad523aa170a754bd485ea73a621c5d0 /app/models/member.rb | |
parent | 00481b78c8f508e2faef5b004e8ea5fb560f51ee (diff) | |
download | redmine-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/member.rb')
-rw-r--r-- | app/models/member.rb | 11 |
1 files changed, 0 insertions, 11 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 |