Class: HhPackage::AgendaService::UpdateRegular

Inherits:
Trailblazer::Operation
  • Object
show all
Defined in:
app/my_lib/hh_package/agenda_service/update_regular.rb

Overview

Create agenda that occurs weekly See Forms::AgendaRegular for the parameters

To check

schedule.occurring_at? date

Instance Method Summary collapse

Instance Method Details

#update(options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
25
26
27
# File 'app/my_lib/hh_package/agenda_service/update_regular.rb', line 19

def update(options, *)
  ActiveRecord::Base.transaction do
    params = get_params(options).except(:id)
    options['model'].assign_attributes params
    return true if options['model'].valid? && options['model'].save
    options['result.contract.default'].errors.add :base, options['model'].errors.full_messages.to_sentence
    false
  end
end