Permalink
Browse files

Don't try to log protected attribute removal if there's no logger def…

…ined [#3135 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
1 parent 41b3c91 commit e870e24887e829547abdb6592d614c52f5412132 @packagethief packagethief committed with josh Sep 2, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/base.rb
@@ -2943,7 +2943,9 @@ def remove_readonly_attributes(attributes)
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.

0 comments on commit e870e24

Please sign in to comment.