mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
change AMo::ForbiddenAttributesProtection#sanitize_for_mass_assignment to protected
This commit is contained in:
parent
1e56f1f14c
commit
6783c3f449
1 changed files with 8 additions and 7 deletions
|
@ -14,13 +14,14 @@ module ActiveModel
|
|||
class ForbiddenAttributesError < StandardError
|
||||
end
|
||||
|
||||
module ForbiddenAttributesProtection
|
||||
def sanitize_for_mass_assignment(attributes, options = {})
|
||||
if attributes.respond_to?(:permitted?) && !attributes.permitted?
|
||||
raise ActiveModel::ForbiddenAttributesError
|
||||
else
|
||||
attributes
|
||||
module ForbiddenAttributesProtection # :nodoc:
|
||||
protected
|
||||
def sanitize_for_mass_assignment(attributes, options = {})
|
||||
if attributes.respond_to?(:permitted?) && !attributes.permitted?
|
||||
raise ActiveModel::ForbiddenAttributesError
|
||||
else
|
||||
attributes
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue