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:
@@ -1,6 +1,7 @@
|
||||
module ApplicationHelper
|
||||
def home_page?
|
||||
return false if user_signed_in?
|
||||
|
||||
# Using path because fullpath yields false negatives since it contains
|
||||
# parameters too
|
||||
request.path == "/"
|
||||
@@ -41,6 +42,7 @@ module ApplicationHelper
|
||||
|
||||
def author_of?(authorable, user)
|
||||
return false if authorable.blank? || user.blank?
|
||||
|
||||
authorable.author_id == user.id
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user