Skip to content

Commit

Permalink
Store previous verbose setting before it can fail in tests.
Browse files Browse the repository at this point in the history
- thanks to hoisting it can be wrongly set to nil instead of previous value
  • Loading branch information
simi committed Jul 31, 2022
1 parent a01d6f8 commit bfdf158
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/tasks/database_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ def truncate_all(environment = env)
end

def migrate(version = nil)
check_target_version

scope = ENV["SCOPE"]
verbose_was, Migration.verbose = Migration.verbose, verbose?

check_target_version

Base.connection.migration_context.migrate(target_version) do |migration|
if version.blank?
scope.blank? || scope == migration.scope
Expand Down

0 comments on commit bfdf158

Please sign in to comment.