Method: TestProf::AnyFixture::Dump::PostgreSQL#import

Defined in:
lib/test_prof/any_fixture/dump/postgresql.rb

#import(path) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/test_prof/any_fixture/dump/postgresql.rb', line 29

def import(path)
  # Test if psql is installed
  `psql --version`

  tasks = ActiveRecord::Tasks::PostgreSQLDatabaseTasks.new(config)

  while_disconnected do
    tasks.structure_load(path, "--output=/dev/null")
  end

  true
rescue Errno::ENOENT
  false
end