Module: ArCache::ActiveRecord::InsertAll

Defined in:
lib/ar_cache/active_record/insert_all.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
# File 'lib/ar_cache/active_record/insert_all.rb', line 6

def execute
  super.tap do
    if on_duplicate == :update
      connection.current_transaction.update_ar_cache_table(model.ar_cache_table)
    else # insert
      connection.transaction_manager.add_transaction_table(model.table_name)
    end
  end
end