diff --git a/lib/standalone_migrations/tasks.rb b/lib/standalone_migrations/tasks.rb index 124b3b2..2309003 100644 --- a/lib/standalone_migrations/tasks.rb +++ b/lib/standalone_migrations/tasks.rb @@ -8,9 +8,7 @@ def configure(options = {}) def load_tasks(options = {}) configure(options) - Configurator.environments_config do |proxy| - ActiveRecord::Tasks::DatabaseTasks.database_configuration = proxy.configurations - end + MinimalRailtieConfig.load_tasks %w( connection diff --git a/lib/standalone_migrations/tasks/connection.rake b/lib/standalone_migrations/tasks/connection.rake index fea6bad..af70450 100644 --- a/lib/standalone_migrations/tasks/connection.rake +++ b/lib/standalone_migrations/tasks/connection.rake @@ -1,6 +1,9 @@ require File.expand_path("../../../standalone_migrations", __FILE__) namespace :standalone do task :connection do + StandaloneMigrations::Configurator.environments_config do |proxy| + ActiveRecord::Tasks::DatabaseTasks.database_configuration = proxy.configurations + end StandaloneMigrations::Configurator.load_configurations ActiveRecord::Base.establish_connection StandaloneMigrations.run_on_load_callbacks