Commit 7b84ec00 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'bvl-multiple-codeowner-approval-rules-ce' into 'master'

Add a scope to preload emails on a user

See merge request gitlab-org/gitlab-ce!25051
parents 8752254d 08e3907b
...@@ -275,6 +275,7 @@ class User < ApplicationRecord ...@@ -275,6 +275,7 @@ class User < ApplicationRecord
scope :confirmed, -> { where.not(confirmed_at: nil) } scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :by_username, -> (usernames) { iwhere(username: Array(usernames).map(&:to_s)) } scope :by_username, -> (usernames) { iwhere(username: Array(usernames).map(&:to_s)) }
scope :for_todos, -> (todos) { where(id: todos.select(:user_id)) } 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. # 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