module Backhoe

Constants

Mysql2
VERSION

Public Class Methods

dump(file_path: Backhoe.file_path, **options) click to toggle source
# File lib/backhoe.rb, line 11
def dump file_path: Backhoe.file_path, **options
  autodetect_adapter.new(database_config, file_path).dump **options
end
load(file_path: Backhoe.file_path) click to toggle source
# File lib/backhoe.rb, line 15
def load file_path: Backhoe.file_path
  autodetect_adapter.new(database_config, file_path).load
end

Private Class Methods

autodetect_adapter() click to toggle source
# File lib/backhoe.rb, line 21
def autodetect_adapter
  const_get(database_config["adapter"].camelize)
end
database_config() click to toggle source
# File lib/backhoe.rb, line 25
def database_config
  env = Rails.env || "development"
  config = ActiveRecord::Base.configurations[env]
  HashWithIndifferentAccess.new(config)
end