aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeffrey Hardy <packagethief@gmail.com>2009-09-02 11:20:52 -0500
committerJoshua Peek <josh@joshpeek.com>2009-09-02 11:21:20 -0500
commite870e24887e829547abdb6592d614c52f5412132 (patch)
treef2bff7622d46257482eae380c670ec6d1c46fd30 /activerecord
parent41b3c912b769596f70d078e3b70b23fd8e98bd47 (diff)
downloadrails-e870e24887e829547abdb6592d614c52f5412132.tar.gz
rails-e870e24887e829547abdb6592d614c52f5412132.tar.bz2
rails-e870e24887e829547abdb6592d614c52f5412132.zip
Don't try to log protected attribute removal if there's no logger defined [#3135 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index c5be561ea3..72742cb57c 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2943,7 +2943,9 @@ module ActiveRecord #:nodoc:
end
def log_protected_attribute_removal(*attributes)
- logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
+ if logger
+ logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
+ end
end
# The primary key and inheritance column can never be set by mass-assignment for security reasons.