diff options
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 6 | ||||
-rw-r--r-- | railties/test/railties/shared_tests.rb | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index aedda26ba5..8e5332214c 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -5,7 +5,6 @@ namespace :db do ActiveRecord::Migrator.migrations_path = Rails.application.config.paths.db.migrate.to_a.first end - desc "Copies missing migrations from Railties (e.g. plugins, engines). You can specify Railties to use with FROM=railtie1,railtie2" task :copy_migrations => :load_config do to_load = ENV["FROM"].blank? ? :all : ENV["FROM"].split(",").map {|n| n.strip } railties = {} @@ -502,6 +501,11 @@ namespace :db do end end +namespace :railties do + desc "Copies missing migrations from Railties (e.g. plugins, engines). You can specify Railties to use with FROM=railtie1,railtie2" + task :copy_migrations => 'db:copy_migrations' +end + task 'test:prepare' => 'db:test:prepare' def drop_database(config) diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 068ea932e2..9b62f88fd7 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -38,7 +38,7 @@ module RailtiesTest add_to_config "ActiveRecord::Base.timestamped_migrations = false" Dir.chdir(app_path) do - output = `rake db:copy_migrations FROM=bukkits` + output = `rake railties:copy_migrations FROM=bukkits` assert File.exists?("#{app_path}/db/migrate/2_create_users.bukkits.rb") assert File.exists?("#{app_path}/db/migrate/3_add_last_name_to_users.bukkits.rb") @@ -46,13 +46,13 @@ module RailtiesTest assert_match /3_add_last_name_to_users/, output assert_equal 3, Dir["#{app_path}/db/migrate/*.rb"].length - output = `rake db:copy_migrations` + output = `rake railties:copy_migrations` assert File.exists?("#{app_path}/db/migrate/4_create_yaffles.acts_as_yaffle.rb") assert_match /4_create_yaffles/, output migrations_count = Dir["#{app_path}/db/migrate/*.rb"].length - output = `rake db:copy_migrations` + output = `rake railties:copy_migrations` assert_equal migrations_count, Dir["#{app_path}/db/migrate/*.rb"].length assert_match /No migrations were copied/, output |