Skip to content

Commit

Permalink
Allows other rake tasks to be executed when db/config.yml is missing.…
Browse files Browse the repository at this point in the history
… Watch PR: thuss#153
  • Loading branch information
gwynolanga committed May 3, 2021
1 parent 85abe5b commit 21ab38b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/standalone_migrations/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ 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
Expand Down
3 changes: 3 additions & 0 deletions lib/standalone_migrations/tasks/connection.rake
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 21ab38b

Please sign in to comment.