1
0
Fork 0
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:
Francesco Rodriguez 2012-09-20 12:14:29 -05:00
parent 1e56f1f14c
commit 6783c3f449

View file

@ -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