Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when a method starts with a `return` statement. In other cases, we probably shouldn't have a guard rule in the middle of a method in any case, but that's a different refactoring.
This commit is contained in:
@@ -43,6 +43,7 @@ class Verification::Management::Email
|
||||
|
||||
def validate_user
|
||||
return if errors.count > 0
|
||||
|
||||
if !user?
|
||||
errors.add(:email, I18n.t("errors.messages.user_not_found"))
|
||||
elsif user.level_three_verified?
|
||||
@@ -52,6 +53,7 @@ class Verification::Management::Email
|
||||
|
||||
def validate_document_number
|
||||
return if errors.count > 0
|
||||
|
||||
if document_number_mismatch?
|
||||
errors.add(:email,
|
||||
I18n.t("management.email_verifications.document_mismatch",
|
||||
|
||||
Reference in New Issue
Block a user