mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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>
This commit is contained in:
parent
41b3c912b7
commit
e870e24887
1 changed files with 3 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue