Class: TestData::InsertsTestData

Inherits:
Object
  • Object
show all
Defined in:
lib/test_data/inserts_test_data.rb

Instance Method Summary collapse

Constructor Details

#initializeInsertsTestData

Returns a new instance of InsertsTestData.



3
4
5
6
# File 'lib/test_data/inserts_test_data.rb', line 3

def initialize
  @config = TestData.config
  @statistics = TestData.statistics
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/test_data/inserts_test_data.rb', line 8

def call
  search_path = connection.execute("show search_path").first["search_path"]
  connection.disable_referential_integrity do
    connection.execute(File.read(@config.data_dump_full_path))
  end
  connection.execute <<~SQL
    select pg_catalog.set_config('search_path', '#{search_path}', false)
  SQL
  @statistics.count_load!
end