Class: TestData::InsertsTestData
- Inherits:
-
Object
- Object
- TestData::InsertsTestData
- Defined in:
- lib/test_data/inserts_test_data.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ InsertsTestData
constructor
A new instance of InsertsTestData.
Constructor Details
#initialize ⇒ InsertsTestData
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
#call ⇒ Object
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 |