Use principals in acts_as_watchable (#4511).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@19725 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-04-25 08:00:55 +00:00
parent f09e0e8f8c
commit b270a38928

View File

@@ -31,7 +31,7 @@ module Redmine
# Returns an array of users that are proposed as watchers
def addable_watcher_users
users = (self.project.users.sort + self.project.principals.merge(Group.givable).sort) - self.watcher_users
users = self.project.principals.where(:users => {:type => ['User', 'Group']}).sort - self.watcher_users
if respond_to?(:visible?)
users.reject! {|user| user.is_a?(User) && !visible?(user)}
end