Autofix Rubocop Style/RedundantBegin (#23703)
This commit is contained in:
parent
167709f6b0
commit
2177daeae9
69 changed files with 458 additions and 695 deletions
|
@ -42,13 +42,11 @@ module PamAuthenticable
|
|||
def self.pam_get_user(attributes = {})
|
||||
return nil unless attributes[:email]
|
||||
|
||||
resource = begin
|
||||
if Devise.check_at_sign && !attributes[:email].index('@')
|
||||
joins(:account).find_by(accounts: { username: attributes[:email] })
|
||||
else
|
||||
find_by(email: attributes[:email])
|
||||
end
|
||||
end
|
||||
resource = if Devise.check_at_sign && !attributes[:email].index('@')
|
||||
joins(:account).find_by(accounts: { username: attributes[:email] })
|
||||
else
|
||||
find_by(email: attributes[:email])
|
||||
end
|
||||
|
||||
if resource.nil?
|
||||
resource = new(email: attributes[:email], agreement: true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue