diff options
-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. |