From e870e24887e829547abdb6592d614c52f5412132 Mon Sep 17 00:00:00 2001 From: Jeffrey Hardy Date: Wed, 2 Sep 2009 11:20:52 -0500 Subject: Don't try to log protected attribute removal if there's no logger defined [#3135 state:resolved] Signed-off-by: Joshua Peek --- activerecord/lib/active_record/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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. -- cgit v1.2.3