aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:16:52 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:16:52 +0000
commit908e9a17d8166d9b83609ec3aa877717a21d8ab7 (patch)
tree6420b491024e5276fede0c3500440a3335ac4df4 /activerecord
parentc29db9f210c81a757e035ee6c8e1a055f6b676b3 (diff)
downloadrails-908e9a17d8166d9b83609ec3aa877717a21d8ab7.tar.gz
rails-908e9a17d8166d9b83609ec3aa877717a21d8ab7.tar.bz2
rails-908e9a17d8166d9b83609ec3aa877717a21d8ab7.zip
Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/base.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 6804fc69fd..810fc94d97 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
+
* Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
* Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 3a1a590be8..7ef6532e52 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -662,9 +662,10 @@ module ActiveRecord #:nodoc:
# Silences the logger for the duration of the block.
def silence
result = nil
+ old_logger_level = logger.level if logger
logger.level = Logger::ERROR if logger
result = yield
- logger.level = Logger::DEBUG if logger
+ logger.level = old_logger_level if logger
return result
end