Class: Stealth::Migrations::Tasks

Inherits:
Object
  • Object
show all
Defined in:
lib/stealth/migrations/tasks.rb

Class Method Summary collapse

Class Method Details

.configureObject



9
10
11
12
13
14
15
16
17
# File 'lib/stealth/migrations/tasks.rb', line 9

def configure
  configurator = Configurator.new

  paths = Rails.application.config.paths

  paths.add "config/database", with: configurator.config
  paths.add "db/migrate", with: configurator.migrate_dir
  paths.add "db/seeds.rb", with: configurator.seeds
end

.load_tasksObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/stealth/migrations/tasks.rb', line 19

def load_tasks
  return unless defined?(ActiveRecord)

  configure

  Configurator.environments_config do |proxy|
    ActiveRecord::Tasks::DatabaseTasks.database_configuration = proxy.configurations
  end

  RailtieConfig.load_tasks

  # %w(
  #   connection
  #   environment
  #   db/new_migration
  # ).each do
  #   |task| load "stealth/migrations/tasks/#{task}.rake"
  # end

  load "active_record/railties/databases.rake"
end