Autofix Rubocop Style/RedundantBegin (#23703)
This commit is contained in:
parent
167709f6b0
commit
2177daeae9
69 changed files with 458 additions and 695 deletions
|
@ -4,13 +4,11 @@ class DomainValidator < ActiveModel::EachValidator
|
|||
def validate_each(record, attribute, value)
|
||||
return if value.blank?
|
||||
|
||||
domain = begin
|
||||
if options[:acct]
|
||||
value.split('@').last
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
domain = if options[:acct]
|
||||
value.split('@').last
|
||||
else
|
||||
value
|
||||
end
|
||||
|
||||
record.errors.add(attribute, I18n.t('domain_validator.invalid_domain')) unless compliant?(domain)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue