Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #10789. Now at last ::Logger doesn't support #silence method .

  • Loading branch information...
commit 8ae73f11469e12d5f3f119189a4733a3a25ca785 1 parent 0434754
@kennyj kennyj authored tenderlove committed
View
4 activerecord/lib/active_record/migration.rb
@@ -360,9 +360,7 @@ def initialize(app)
end
def call(env)
- ActiveRecord::Base.logger.silence do
- ActiveRecord::Migration.check_pending!
- end
+ ActiveRecord::Migration.check_pending!
@app.call(env)
end
end
View
9 activerecord/test/cases/migration_test.rb
@@ -849,4 +849,13 @@ def test_copying_migrations_to_empty_directory
ensure
clear
end
+
+ def test_check_pending_with_stdlib_logger
+ old, ActiveRecord::Base.logger = ActiveRecord::Base.logger, ::Logger.new($stdout)
+ quietly do
+ assert_nothing_raised { ActiveRecord::Migration::CheckPending.new(Proc.new {}).call({}) }
+ end
+ ensure
+ ActiveRecord::Base.logger = old
+ end
end

2 comments on commit 8ae73f1

@rafaelfranca

@tenderlove we need that silence call, or at least a way to silence the migrations checks output on the log files.

@907th

@rafaelfranca @tenderlove I reverted that in #10859

Please sign in to comment.
Something went wrong with that request. Please try again.