diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-20 12:14:29 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-20 12:18:59 -0500 |
commit | 6783c3f449f9c80268905fe79e444f40d1b2f883 (patch) | |
tree | 0a6b1db6464e1979d51bbc39769780506ff7c162 /activemodel | |
parent | 1e56f1f14c7b033a6d180514c83e61193812fede (diff) | |
download | rails-6783c3f449f9c80268905fe79e444f40d1b2f883.tar.gz rails-6783c3f449f9c80268905fe79e444f40d1b2f883.tar.bz2 rails-6783c3f449f9c80268905fe79e444f40d1b2f883.zip |
change AMo::ForbiddenAttributesProtection#sanitize_for_mass_assignment to protected
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/forbidden_attributes_protection.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activemodel/lib/active_model/forbidden_attributes_protection.rb b/activemodel/lib/active_model/forbidden_attributes_protection.rb index f4c5d536eb..4c05b19cba 100644 --- a/activemodel/lib/active_model/forbidden_attributes_protection.rb +++ b/activemodel/lib/active_model/forbidden_attributes_protection.rb @@ -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 |