diff options
author | Logan King <logan.c.king@gmail.com> | 2019-03-22 21:28:25 +0300 |
---|---|---|
committer | Logan King <logan.c.king@gmail.com> | 2019-03-22 21:28:25 +0300 |
commit | 66eae48eb56cff77f5e68ffb2a271e3a66df606a (patch) | |
tree | 32949944a6b3a0c8365be4ca1fece061016ed3b1 /app/models/user.rb | |
parent | 85a1acbe50a3db74d0298fc622170f0fd000988d (diff) |
Add with_dashboard scope to User
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 1 |
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. # |