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,8 +2943,10 @@ module ActiveRecord #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
def log_protected_attribute_removal(*attributes)
|
def log_protected_attribute_removal(*attributes)
|
||||||
|
if logger
|
||||||
logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
|
logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# The primary key and inheritance column can never be set by mass-assignment for security reasons.
|
# The primary key and inheritance column can never be set by mass-assignment for security reasons.
|
||||||
def attributes_protected_by_default
|
def attributes_protected_by_default
|
||||||
|
|
Loading…
Reference in a new issue