Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-06-06 16:50:58 +0300
committerPaco Guzman <pacoguzmanp@gmail.com>2016-06-06 16:51:56 +0300
commit3b21174d32695d10124bd4d582db14947bf4162d (patch)
treeb8b862ff0345ab1d0b7cc59f9514b08328ae1c7d /app/controllers/sessions_controller.rb
parent3cb69f0c0b0049426e6abad0914812a9eef87b04 (diff)
Check if the Users table has exactly one user limiting the whole set
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r--app/controllers/sessions_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index f6eedb1773c..fd57478fc9e 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -39,7 +39,7 @@ class SessionsController < Devise::SessionsController
# Handle an "initial setup" state, where there's only one user, it's an admin,
# and they require a password change.
def check_initial_setup
- return unless User.count == 1
+ return unless User.limit(2).count == 1 # Count as much 2 to know if we have exactly one
user = User.admins.last