summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-09 12:43:47 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-08-15 17:20:57 -0500
commit5994c11910822463faeabb7b5f11d6529036db9d (patch)
treea80a8ffea4d4ef868790aab627abfcaa1c982d10 /app/controllers/concerns
parent43e756d4eafd79f4d2f366b646ebb94af78b5a4c (diff)
downloadgitlab-ce-5994c11910822463faeabb7b5f11d6529036db9d.tar.gz
Further refactor and syntax fixes.
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/spammable_actions.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/concerns/spammable_actions.rb b/app/controllers/concerns/spammable_actions.rb
index 296811267e5..29e243c66a3 100644
--- a/app/controllers/concerns/spammable_actions.rb
+++ b/app/controllers/concerns/spammable_actions.rb
@@ -6,18 +6,17 @@ module SpammableActions
end
def mark_as_spam
- if SpamService.new(spammable).mark_as_spam!(current_user)
- redirect_to spammable, notice: 'Issue was submitted to Akismet successfully.'
+ if SpamService.new(spammable).mark_as_spam!
+ redirect_to spammable, notice: "#{spammable.class.to_s} was submitted to Akismet successfully."
else
- flash[:error] = 'Error with Akismet. Please check the logs for more info.'
- redirect_to spammable
+ redirect_to spammable, alert: 'Error with Akismet. Please check the logs for more info.'
end
end
private
def spammable
- raise NotImplementedError
+ raise NotImplementedError, "#{self.class} does not implement #{__method__}"
end
def authorize_submit_spammable!