Module: PgBackup::Helpers::Database

Defined in:
lib/pg_backup/helpers/database.rb

Instance Method Summary collapse

Instance Method Details

#connection_configObject



14
15
16
# File 'lib/pg_backup/helpers/database.rb', line 14

def connection_config
  ActiveRecord::Base.connection_config
end

#with_database_config {|connection_config.fetch(:host, 'localhost'), connection_config.fetch(:database), connection_config.fetch(:username), connection_config.fetch(:password)| ... } ⇒ Object

Yields:



5
6
7
8
9
10
11
12
# File 'lib/pg_backup/helpers/database.rb', line 5

def with_database_config
  yield(
    connection_config.fetch(:host, 'localhost'),
    connection_config.fetch(:database),
    connection_config.fetch(:username),
    connection_config.fetch(:password)
  )
end