Module: CustomPostgresCopy

Defined in:
lib/custom_postgres_copy.rb

Instance Method Summary collapse

Instance Method Details

#make_copy(repository, import_file) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/custom_postgres_copy.rb', line 2

def make_copy(repository, import_file)
  repository.extend(PostgresCopy::ActsAsCopyTarget::CopyMethods)

  repository.copy_from Unico::Engine.config.root.join(import_file).to_s

  ActiveRecord::Base.connection.reset_pk_sequence!(repository.table_name)
end