diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index dc84f5141d8..fb330ff7185 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -177,6 +177,10 @@ class User < ActiveRecord::Base # Note: When adding an option, it MUST go on the end of the array. enum dashboard: [:projects, :stars] + # User's Project preference + # Note: When adding an option, it MUST go on the end of the array. + enum project_view: [:readme, :activity] + alias_attribute :private_token, :authentication_token delegate :path, to: :namespace, allow_nil: true, prefix: true @@ -322,6 +326,16 @@ class User < ActiveRecord::Base @reset_token end + def disable_two_factor! + update_attributes( + two_factor_enabled: false, + encrypted_otp_secret: nil, + encrypted_otp_secret_iv: nil, + encrypted_otp_secret_salt: nil, + otp_backup_codes: nil + ) + end + def namespace_uniq namespace_name = self.username existing_namespace = Namespace.by_path(namespace_name) |