Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Includes:
ConnectionAdapters::ConstraintConnectionHook
Defined in:
lib/activerecord_constraint_handlers.rb

Instance Method Summary collapse

Methods included from ConnectionAdapters::ConstraintConnectionHook

included

Instance Method Details

#create_or_update_with_constraintsObject

Insert into the create_or_update call chain



293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/activerecord_constraint_handlers.rb', line 293

def create_or_update_with_constraints
  begin
    self.class.pre_fetch if self.class.respond_to? :pre_fetch
    create_or_update_without_constraints
  rescue => e
    if respond_to?(:handle_create_or_update_exception)
      handle_create_or_update_exception(e)
    else
      raise e
    end
  end
end