diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 20:15:45 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 22:31:26 +0200 |
commit | a9bf91ea5640ab9ed9d6d7ba9da780ea1dfbd6e3 (patch) | |
tree | f0caf07302be801c243fa6440a118a911cb476f2 /railties/lib | |
parent | b417cfbf01a17be7216d09e447f37bf1c19e4cb2 (diff) | |
download | rails-a9bf91ea5640ab9ed9d6d7ba9da780ea1dfbd6e3.tar.gz rails-a9bf91ea5640ab9ed9d6d7ba9da780ea1dfbd6e3.tar.bz2 rails-a9bf91ea5640ab9ed9d6d7ba9da780ea1dfbd6e3.zip |
Add 'foo:install:migrations' task to copy migrations from foo engine
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/engine.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 909840da04..4acebb4769 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -522,6 +522,20 @@ module Rails # consistently executed after all the initializers above across all engines. end + rake_tasks do + next if self.is_a?(Rails::Application) + + namespace railtie_name do + namespace :install do + desc "Copy migrations from #{railtie_name} to application" + task :migrations do + ENV["FROM"] = railtie_name + Rake::Task["railties:install:migrations"].invoke + end + end + end + end + protected def routes? defined?(@routes) |