[Comments] Simplify should_see?

This commit is contained in:
Earlopain 2024-01-22 18:57:44 +01:00
parent 23fcee2356
commit c4bd8e961f
No known key found for this signature in database
GPG Key ID: 48860312319ADF61

View File

@ -203,9 +203,8 @@ class Comment < ApplicationRecord
end
def should_see?(user)
return true if user.is_moderator?
return true unless is_hidden?
(creator_id == user.id) && user.show_hidden_comments?
return true if creator_id == user.id && is_hidden? && user.show_hidden_comments?
visible_to?(user)
end
def method_attributes