summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan King <logan.c.king@gmail.com>2019-03-22 12:28:25 -0600
committerLogan King <logan.c.king@gmail.com>2019-03-22 12:28:25 -0600
commit66eae48eb56cff77f5e68ffb2a271e3a66df606a (patch)
tree32949944a6b3a0c8365be4ca1fece061016ed3b1
parent85a1acbe50a3db74d0298fc622170f0fd000988d (diff)
downloadgitlab-ce-ce-8317-operations-dashboard-usage-ping.tar.gz
Add with_dashboard scope to Userce-8317-operations-dashboard-usage-ping
-rw-r--r--app/models/user.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index d2be26370ff..c1648008b6c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -276,6 +276,7 @@ class User < ApplicationRecord
scope :by_username, -> (usernames) { iwhere(username: Array(usernames).map(&:to_s)) }
scope :for_todos, -> (todos) { where(id: todos.select(:user_id)) }
scope :with_emails, -> { preload(:emails) }
+ scope :with_dashboard, -> (dashboard) { where(dashboard: dashboard) }
# Limits the users to those that have TODOs, optionally in the given state.
#