Commit 66eae48e authored by Logan King's avatar Logan King

Add with_dashboard scope to User

parent 85a1acbe
......@@ -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.
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment