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:
authorRobert Speicher <rspeicher@gmail.com>2015-06-21 02:40:48 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-21 02:40:48 +0300
commitd3ff8c1a952b6bee75eac80f4ac61a7b70cb4eb0 (patch)
tree32f6c427c18d4d654f97917989306433dd0ad5e3 /app/models/user.rb
parent8304bed105a75b1380b963e5f943de7443105d98 (diff)
Make default value for otp_required_for_login false instead of null
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 57a36a73ac5..9f1bdb12508 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -50,12 +50,12 @@
# bitbucket_access_token :string(255)
# bitbucket_access_token_secret :string(255)
# location :string(255)
-# public_email :string(255) default(""), not null
# encrypted_otp_secret :string(255)
# encrypted_otp_secret_iv :string(255)
# encrypted_otp_secret_salt :string(255)
-# otp_required_for_login :boolean
+# otp_required_for_login :boolean default(FALSE), not null
# otp_backup_codes :text
+# public_email :string(255) default(""), not null
# dashboard :integer default(0)
#
@@ -198,8 +198,8 @@ class User < ActiveRecord::Base
scope :active, -> { with_state(:active) }
scope :not_in_project, ->(project) { project.users.present? ? where("id not in (:ids)", ids: project.users.map(&:id) ) : all }
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members)') }
- scope :with_two_factor, -> { where('otp_required_for_login IS true') }
- scope :without_two_factor, -> { where('otp_required_for_login IS NOT true') }
+ scope :with_two_factor, -> { where(otp_required_for_login: true) }
+ scope :without_two_factor, -> { where(otp_required_for_login: false) }
#
# Class methods