Permalink
Browse files

Don't allow AR::Tasks::DatabaseTasks.migrate to mutate Migration.verb…

…ose value

This fixes random test failure in migrator_test.rb
  • Loading branch information...
1 parent 4606e75 commit f8d9a51949d6f6cfcab7cc7d501e137836eb88dc @amatsuda amatsuda committed Aug 29, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/tasks/database_tasks.rb
@@ -131,10 +131,12 @@ def migrate
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)

0 comments on commit f8d9a51

Please sign in to comment.