diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-06 01:10:08 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-08-15 21:18:15 +0300 |
commit | 43e756d4eafd79f4d2f366b646ebb94af78b5a4c (patch) | |
tree | 07949d3368affcda301fd266e1e5bf0649474b23 /app/controllers/admin | |
parent | 7179165af7553720089a0b7e7024374c371e2f90 (diff) |
Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/spam_logs_controller.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/admin/spam_logs_controller.rb b/app/controllers/admin/spam_logs_controller.rb index d15f00bf84c..7876d2ee767 100644 --- a/app/controllers/admin/spam_logs_controller.rb +++ b/app/controllers/admin/spam_logs_controller.rb @@ -1,5 +1,4 @@ class Admin::SpamLogsController < Admin::ApplicationController - include Gitlab::AkismetHelper def index @spam_logs = SpamLog.order(id: :desc).page(params[:page]) @@ -20,8 +19,7 @@ class Admin::SpamLogsController < Admin::ApplicationController def mark_as_ham spam_log = SpamLog.find(params[:id]) - if ham!(spam_log.source_ip, spam_log.user_agent, spam_log.text, spam_log.user) - spam_log.update_attribute(:submitted_as_ham, true) + if SpamService.new(spam_log).mark_as_ham! redirect_to admin_spam_logs_path, notice: 'Spam log successfully submitted as ham.' else redirect_to admin_spam_logs_path, notice: 'Error with Akismet. Please check the logs for more info.' |