Skip to content

Commit

Permalink
Don't allow AR::Tasks::DatabaseTasks.migrate to mutate Migration.verb…
Browse files Browse the repository at this point in the history
…ose value

This fixes random test failure in migrator_test.rb
  • Loading branch information
amatsuda committed Aug 29, 2014
1 parent 4606e75 commit f8d9a51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion activerecord/lib/active_record/tasks/database_tasks.rb
Expand Up @@ -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)
Expand Down

0 comments on commit f8d9a51

Please sign in to comment.