We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a46a6d4 commit 3c548fdCopy full SHA for 3c548fd
app/controllers/reports_controller.rb
@@ -2,13 +2,17 @@
2
3
class ReportsController < ApplicationController
4
def create
5
- authorize(reported_content, policy_class: ReportPolicy)
+ authorize!
6
ReportMailer.with(reported_content:).report_content.deliver_later
7
redirect_back(fallback_location: :root, notice: t('reports.reported'))
8
end
9
10
private
11
12
+ def authorize!
13
+ authorize(reported_content, policy_class: ReportPolicy)
14
+ end
15
+
16
def reported_content
17
@reported_content ||= GlobalID::Locator.locate(params.require(:global_content_id))
18
0 commit comments