Module: ActiveRecordUpsert::ActiveRecord::Persistence

Defined in:
lib/active_record_upsert/active_record/persistence.rb

Instance Method Summary collapse

Instance Method Details

#_upsert_record(values, on_duplicate) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/active_record_upsert/active_record/persistence.rb', line 4

def _upsert_record(values, on_duplicate)
  set_timestamps(values)
  set_primary_key_value(values) unless composite?

  im = compile_insert(values, on_duplicate)
  connection.insert(im, "#{self} Upsert", primary_key || false, values[primary_key])
end