From 881c4c497a6c04f6cef8464f83993c6759578c24 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Tue, 21 Apr 2020 00:29:09 +0300 Subject: [PATCH 3/4] Use principals in acts_as_watchable --- lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb index e37151d8f..bb04eb7f0 100644 --- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb +++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb @@ -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 -- 2.22.0