Skip to content

Commit

Permalink
Don't try to log protected attribute removal if there's no logger def…
Browse files Browse the repository at this point in the history
…ined [#3135 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
packagethief authored and josh committed Sep 2, 2009
1 parent 41b3c91 commit e870e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -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.
Expand Down

0 comments on commit e870e24

Please sign in to comment.