Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save erlend/e0bb2dd9dd2c05dd1dd4 to your computer and use it in GitHub Desktop.
Save erlend/e0bb2dd9dd2c05dd1dd4 to your computer and use it in GitHub Desktop.
namespace :db do
task :load_config do
ActiveRecord::Base.configurations = ActiveRecord::Tasks::DatabaseTasks.database_configuration || {}
ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH)
if engine.paths['db/migrate'].existent
ActiveRecord::Migrator.migrations_paths += engine.paths['db/migrate'].to_a
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment