Class: CreateSpamLogService

Inherits:
BaseService show all
Defined in:
app/services/create_spam_log_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#abilities, #can?, #deny_visibility_level, #event_service, #log_info, #notification_service, #repository, #system_hook_service, #todo_service

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Constructor Details

#initialize(project, user, params) ⇒ CreateSpamLogService

Returns a new instance of CreateSpamLogService


2
3
4
# File 'app/services/create_spam_log_service.rb', line 2

def initialize(project, user, params)
  super(project, user, params)
end

Instance Method Details

#executeObject


6
7
8
9
10
11
12
# File 'app/services/create_spam_log_service.rb', line 6

def execute
  spam_params = params.merge({ user_id: @current_user.id,
                               project_id: @project.id } )
  spam_log = SpamLog.new(spam_params)
  spam_log.save
  spam_log
end