Skip to content
Browse files

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

  • Loading branch information...
1 parent 0434754 commit 8ae73f11469e12d5f3f119189a4733a3a25ca785 @kennyj kennyj committed with tenderlove Jun 4, 2013
Showing with 10 additions and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/migration.rb
  2. +9 −0 activerecord/test/cases/migration_test.rb
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
Ruby on Rails member

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

@907th
907th commented on 8ae73f1 Jun 5, 2013

@rafaelfranca @tenderlove I reverted that in #10859

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