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

@ -2,8 +2,8 @@
class EmailChangeRequest < ActiveRecord::Base
belongs_to :user
belongs_to :old_email_token, class_name: 'EmailToken', dependent: :destroy
belongs_to :new_email_token, class_name: 'EmailToken', dependent: :destroy
belongs_to :old_email_token, class_name: "EmailToken", dependent: :destroy
belongs_to :new_email_token, class_name: "EmailToken", dependent: :destroy
belongs_to :requested_by, class_name: "User", foreign_key: :requested_by_user_id
validates :new_email, presence: true, format: { with: EmailAddressValidator.email_regex }
@ -14,7 +14,9 @@ class EmailChangeRequest < ActiveRecord::Base
def self.find_by_new_token(token)
EmailChangeRequest
.joins("INNER JOIN email_tokens ON email_tokens.id = email_change_requests.new_email_token_id")
.joins(
"INNER JOIN email_tokens ON email_tokens.id = email_change_requests.new_email_token_id",
)
.where("email_tokens.token_hash = ?", EmailToken.hash_token(token))
.last
end