Minor guard clause refactor (#576)

This commit is contained in:
Arun Kumar 2018-07-16 14:39:24 -05:00 committed by Ben Halpern
parent e2dbd7cfcc
commit e407e1ff91

View file

@ -34,8 +34,7 @@ class Block < ApplicationRecord
end
def permissions
if !user || !user.has_role?(:super_admin)
errors.add(:commentable_id, "is not valid.")
end
return if user&.has_role?(:super_admin)
errors.add(:commentable_id, "is not valid.")
end
end