DEV: Apply syntax_tree formatting to app/*

This commit is contained in:
David Taylor
2023-01-09 12:20:10 +00:00
parent a641ce4b62
commit 5a003715d3
696 changed files with 18447 additions and 15481 deletions

View File

@ -4,24 +4,14 @@ class UserSecondFactor < ActiveRecord::Base
include SecondFactorManager
belongs_to :user
scope :backup_codes, -> do
where(method: UserSecondFactor.methods[:backup_codes], enabled: true)
end
scope :backup_codes, -> { where(method: UserSecondFactor.methods[:backup_codes], enabled: true) }
scope :totps, -> do
where(method: UserSecondFactor.methods[:totp], enabled: true)
end
scope :totps, -> { where(method: UserSecondFactor.methods[:totp], enabled: true) }
scope :all_totps, -> do
where(method: UserSecondFactor.methods[:totp])
end
scope :all_totps, -> { where(method: UserSecondFactor.methods[:totp]) }
def self.methods
@methods ||= Enum.new(
totp: 1,
backup_codes: 2,
security_key: 3,
)
@methods ||= Enum.new(totp: 1, backup_codes: 2, security_key: 3)
end
def totp_object
@ -31,7 +21,6 @@ class UserSecondFactor < ActiveRecord::Base
def totp_provisioning_uri
totp_object.provisioning_uri(user.email)
end
end
# == Schema Information