Module: Iry::Patch

Defined in:
lib/iry/patch.rb

Overview

Overrides private API method ActiveRecord#create_or_update to handle constraints and attach errors to the including model

Instance Method Summary collapse

Instance Method Details

#create_or_updateBoolean

Takes attributes as named arguments

Returns:

  • (Boolean)

    true if successful



7
8
9
10
11
# File 'lib/iry/patch.rb', line 7

def create_or_update(...)
  result = false
  TransformConstraints.nested_constraints!(self) { result = super }
  result
end