summaryrefslogtreecommitdiffstats
path: root/app/models/principal.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-04-25 08:01:59 +0000
committerGo MAEDA <maeda@farend.jp>2020-04-25 08:01:59 +0000
commitee46c3570ec5f3948a94adedfdefd734822f95af (patch)
treec29ca1a1d9a16cf402d41ee339f3769b891b4261 /app/models/principal.rb
parentb270a389281ce37bb3bea6cec68ba7a6ac54dfcb (diff)
downloadredmine-ee46c3570ec5f3948a94adedfdefd734822f95af.tar.gz
redmine-ee46c3570ec5f3948a94adedfdefd734822f95af.zip
Use scope assignable_watchers (#4511).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19726 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/principal.rb')
-rw-r--r--app/models/principal.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/principal.rb b/app/models/principal.rb
index 0c4f239dd..47fa62ba5 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -114,6 +114,9 @@ class Principal < ActiveRecord::Base
}
scope :sorted, lambda { order(*Principal.fields_for_order_statement)}
+ # Principals that can be added as watchers
+ scope :assignable_watchers, lambda { active.visible.where(:type => ['User', 'Group']) }
+
before_create :set_default_empty_values
before_destroy :nullify_projects_default_assigned_to