Permalink
Browse files

Remove MassAssignmentSecurity from ActiveModel

This will be moved out to protected_attributes gem
  • Loading branch information...
guilleiguaran committed Jul 17, 2012
1 parent a8f6d5c commit f8c9a4d3e88181cee644f91e1342bfe896ca64c6
@@ -36,7 +36,6 @@ module ActiveModel
autoload :EachValidator, 'active_model/validator'
autoload :ForbiddenAttributesProtection
autoload :Lint
autoload :MassAssignmentSecurity
autoload :Model
autoload :Name, 'active_model/naming'
autoload :Naming
@@ -3,11 +3,11 @@ class ForbiddenAttributes < StandardError
end
module ForbiddenAttributesProtection
def sanitize_for_mass_assignment(new_attributes, options = {})
if !new_attributes.respond_to?(:permitted?) || (new_attributes.respond_to?(:permitted?) && new_attributes.permitted?)
super
else
def sanitize_for_mass_assignment(attributes, options = {})
if attributes.respond_to?(:permitted?) && !attributes.permitted?
raise ActiveModel::ForbiddenAttributes
else
attributes
end
end
end

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit f8c9a4d

Please sign in to comment.