Forked from doabit/rails 4 rails 4.0.0.rc1 mountable engine rake db:migrate
Created
May 10, 2014 22:58
-
-
Save erlend/e0bb2dd9dd2c05dd1dd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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