Created
June 2, 2013 07:01
-
-
Save doabit/5692865 to your computer and use it in GitHub Desktop.
rails 4.0.0.rc1 mountable engine rake db:migrate task
This file contains 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