0003-Use-principals-in-acts_as_watchable.patch

Marius BALTEANU, 2020-04-25 09:31

Download (1.09 KB)

View differences:

lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
31 31

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