Skip to content

Commit 3c548fd

Browse files
committed
authorize!
1 parent a46a6d4 commit 3c548fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/reports_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
class ReportsController < ApplicationController
44
def create
5-
authorize(reported_content, policy_class: ReportPolicy)
5+
authorize!
66
ReportMailer.with(reported_content:).report_content.deliver_later
77
redirect_back(fallback_location: :root, notice: t('reports.reported'))
88
end
99

1010
private
1111

12+
def authorize!
13+
authorize(reported_content, policy_class: ReportPolicy)
14+
end
15+
1216
def reported_content
1317
@reported_content ||= GlobalID::Locator.locate(params.require(:global_content_id))
1418
end

0 commit comments

Comments
 (0)