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.
10 lines
189 B
Ruby
10 lines
189 B
Ruby
module Conflictable
|
|
extend ActiveSupport::Concern
|
|
|
|
def conflictive?
|
|
return false unless flags_count > 0 && cached_votes_up > 0
|
|
|
|
cached_votes_up / flags_count.to_f < 5
|
|
end
|
|
end
|