Skip to content

Commit 968f36d

Browse files
committed
better method names
1 parent 4b223a2 commit 968f36d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/policies/report_policy.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
class ReportPolicy < ApplicationPolicy
44
def show?
5-
receiver_available? && reportable_content? && reports_other_user?
5+
receiver_configured? && reportable_content? && reports_another_user?
66
end
77

88
def create?
9-
receiver_available? && reportable_content? && reports_other_user?
9+
receiver_configured? && reportable_content? && reports_another_user?
1010
end
1111

1212
private
@@ -15,11 +15,11 @@ def reportable_content?
1515
[RequestForComment, Comment].include?(@record.class)
1616
end
1717

18-
def reports_other_user?
18+
def reports_another_user?
1919
@record.user != @user
2020
end
2121

22-
def receiver_available?
22+
def receiver_configured?
2323
CodeOcean::Config.new(:code_ocean).read.dig(:content_moderation, :report_emails).present?
2424
end
2525
end

0 commit comments

Comments
 (0)