Class: Ci::PipelineSchedules::BaseSaveService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/ci/pipeline_schedules/base_save_service.rb

Direct Known Subclasses

CreateService, UpdateService

Instance Method Summary collapse

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/services/ci/pipeline_schedules/base_save_service.rb', line 8

def execute
  schedule.assign_attributes(params)

  return forbidden_to_save unless allowed_to_save?
  return forbidden_to_save_variables unless allowed_to_save_variables?

  if schedule.save
    ServiceResponse.success(payload: schedule)
  else
    ServiceResponse.error(payload: schedule, message: schedule.errors.full_messages)
  end
end