Method: ScimPatch#save

Defined in:
app/libraries/scim_patch.rb

#save(model) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/libraries/scim_patch.rb', line 28

def save(model)
  model.transaction do
    @operations.each do |operation|
      operation.save(model)
    end
    model.save! if model.changed?
  end
rescue ActiveRecord::RecordNotFound
  raise
rescue StandardError => e
  raise Scimaenaga::ExceptionHandler::UnsupportedPatchRequest, e.message
end