Module: SpammableActions::AkismetMarkAsSpamAction

Extended by:
ActiveSupport::Concern
Included in:
IssuableActions, Projects::SnippetsController, SnippetsController
Defined in:
app/controllers/concerns/spammable_actions/akismet_mark_as_spam_action.rb

Instance Method Summary collapse

Instance Method Details

#mark_as_spamObject



10
11
12
13
14
15
16
# File 'app/controllers/concerns/spammable_actions/akismet_mark_as_spam_action.rb', line 10

def mark_as_spam
  if Spam::AkismetMarkAsSpamService.new(target: spammable).execute
    redirect_to spammable_path, notice: format(_("%{spammable_titlecase} was submitted to Akismet successfully."), spammable_titlecase: spammable.spammable_entity_type.titlecase)
  else
    redirect_to spammable_path, alert: _('Error with Akismet. Please check the logs for more info.')
  end
end