diff options
author | Akira Matsuda <ronnie@dio.jp> | 2014-08-30 02:28:44 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2014-08-30 02:38:20 +0900 |
commit | f8d9a51949d6f6cfcab7cc7d501e137836eb88dc (patch) | |
tree | 91d68f489eaca17ecd763873d9097dfc92c550b3 /activerecord | |
parent | 4606e7527b121ee1ea2e24249ad4db2faaf0c8ad (diff) | |
download | rails-f8d9a51949d6f6cfcab7cc7d501e137836eb88dc.tar.gz rails-f8d9a51949d6f6cfcab7cc7d501e137836eb88dc.tar.bz2 rails-f8d9a51949d6f6cfcab7cc7d501e137836eb88dc.zip |
Don't allow AR::Tasks::DatabaseTasks.migrate to mutate Migration.verbose value
This fixes random test failure in migrator_test.rb
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index e4164f263e..a21c3f1868 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -131,10 +131,12 @@ module ActiveRecord verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil scope = ENV['SCOPE'] - Migration.verbose = verbose + verbose_was = Migration.verbose Migrator.migrate(Migrator.migrations_paths, version) do |migration| scope.blank? || scope == migration.scope end + ensure + Migration.verbose = verbose_was end def charset_current(environment = env) |