aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
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