diff options
author | Jeffrey Hardy <packagethief@gmail.com> | 2009-09-02 11:20:52 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-02 11:21:20 -0500 |
commit | e870e24887e829547abdb6592d614c52f5412132 (patch) | |
tree | f2bff7622d46257482eae380c670ec6d1c46fd30 | |
parent | 41b3c912b769596f70d078e3b70b23fd8e98bd47 (diff) | |
download | rails-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>
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
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. |