diff options
Diffstat (limited to 'app/services/concerns/spam_check_methods.rb')
-rw-r--r-- | app/services/concerns/spam_check_methods.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/services/concerns/spam_check_methods.rb b/app/services/concerns/spam_check_methods.rb index 53e9e001463..939f8f183ab 100644 --- a/app/services/concerns/spam_check_methods.rb +++ b/app/services/concerns/spam_check_methods.rb @@ -22,15 +22,18 @@ module SpamCheckMethods # a dirty instance, which means it should be already assigned with the new # attribute values. # rubocop:disable Gitlab/ModuleWithInstanceVariables - def spam_check(spammable, user) + def spam_check(spammable, user, action:) + raise ArgumentError.new('Please provide an action, such as :create') unless action + Spam::SpamActionService.new( spammable: spammable, - request: @request + request: @request, + user: user, + context: { action: action } ).execute( api: @api, recaptcha_verified: @recaptcha_verified, - spam_log_id: @spam_log_id, - user: user) + spam_log_id: @spam_log_id) end # rubocop:enable Gitlab/ModuleWithInstanceVariables end |