module ActiveRecord::Tasks::DatabaseTasks

Public Instance Methods

perform_pg_db_task_for_config_and_filename(task_name, *arguments) click to toggle source
# File lib/pg_tasks.rb, line 147
def perform_pg_db_task_for_config_and_filename(task_name, *arguments)
  configuration = arguments.first
  filename = arguments.delete_at 1
  class_for_adapter(configuration['adapter']) \
    .new(*arguments).send task_name, filename
rescue ActiveRecord::NoDatabaseError
  $stderr.puts "Database '#{configuration['database']}' does not exist"
rescue Exception => error
  $stderr.puts error, *(error.backtrace)
  raise error
end
terminate_connections(*arguments) click to toggle source
# File lib/pg_tasks.rb, line 159
def terminate_connections(*arguments)
  configuration = arguments.first
  class_for_adapter(configuration['adapter']) \
    .new(*arguments).send :terminate_connections
end