Skip to content
Snippets Groups Projects
Commit 08e3907b authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Add a scope to preload emails on a user

parent 7fa7f03e
No related branches found
No related tags found
Loading
......@@ -275,6 +275,7 @@ def inactive_message
scope :confirmed, -> { where.not(confirmed_at: nil) }
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) }
# Limits the users to those that have TODOs, optionally in the given state.
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment