Permalink
Browse files

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

  • Loading branch information...
1 parent a833467 commit 32998083c96fd481eb6913260c029bd2ec08d1af @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
@@ -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
@@ -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

0 comments on commit 3299808

Please sign in to comment.