summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-05 17:10:08 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-08-15 13:18:15 -0500
commit43e756d4eafd79f4d2f366b646ebb94af78b5a4c (patch)
tree07949d3368affcda301fd266e1e5bf0649474b23 /app/controllers/concerns
parent7179165af7553720089a0b7e7024374c371e2f90 (diff)
downloadgitlab-ce-43e756d4eafd79f4d2f366b646ebb94af78b5a4c.tar.gz
Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/spammable_actions.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/controllers/concerns/spammable_actions.rb b/app/controllers/concerns/spammable_actions.rb
index 85be25d84cc..296811267e5 100644
--- a/app/controllers/concerns/spammable_actions.rb
+++ b/app/controllers/concerns/spammable_actions.rb
@@ -6,13 +6,7 @@ module SpammableActions
end
def mark_as_spam
- if spammable.submit_spam
- spammable.user_agent_detail.update_attribute(:submitted, true)
-
- if spammable.is_a?(Issuable)
- SystemNoteService.submit_spam(spammable, spammable.project, current_user)
- end
-
+ if SpamService.new(spammable).mark_as_spam!(current_user)
redirect_to spammable, notice: 'Issue was submitted to Akismet successfully.'
else
flash[:error] = 'Error with Akismet. Please check the logs for more info.'