From 66eae48eb56cff77f5e68ffb2a271e3a66df606a Mon Sep 17 00:00:00 2001 From: Logan King Date: Fri, 22 Mar 2019 12:28:25 -0600 Subject: Add with_dashboard scope to User --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) 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. # -- cgit v1.2.1