summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2017-12-04 09:49:53 +0000
committerDouwe Maan <douwe@gitlab.com>2017-12-04 09:49:53 +0000
commit7c2b7296d4e623ba4eaa19cf03405ee7f2ae1ca9 (patch)
tree80784f83c52313797b8cf7e78ccf8db66f0880d8 /app/models/user.rb
parentc997c95dfca2c3d30f8c7b8ef5f0fd95c1356226 (diff)
downloadgitlab-ce-7c2b7296d4e623ba4eaa19cf03405ee7f2ae1ca9.tar.gz
Added default order to UserFinder
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 14941fd7f98..5e7fe01c825 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -487,7 +487,11 @@ class User < ActiveRecord::Base
end
def two_factor_u2f_enabled?
- u2f_registrations.exists?
+ if u2f_registrations.loaded?
+ u2f_registrations.any?
+ else
+ u2f_registrations.exists?
+ end
end
def namespace_uniq