From cd17ee5598411728747011566abf6779166be9d3 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Sun, 28 Oct 2012 17:50:56 -0500 Subject: dont encourage AC::Parameters#permit_all_parameters usage [ci skip] --- .../action_controller/metal/strong_parameters.rb | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 73f2e94cd1..f60d2a0a50 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -43,19 +43,6 @@ module ActionController # Person.first.update_attributes!(permitted) # # => # # - # It provides a +permit_all_parameters+ option that controls the top-level - # behaviour of new instances. If it's +true+, all the parameters will be - # permitted by default. The default value for +permit_all_parameters+ - # option is +false+. - # - # params = ActionController::Parameters.new - # params.permitted? # => false - # - # ActionController::Parameters.permit_all_parameters = true - # - # params = ActionController::Parameters.new - # params.permitted? # => true - # # ActionController::Parameters is inherited from # ActiveSupport::HashWithIndifferentAccess, this means # that you can fetch values using either :key or "key". @@ -68,8 +55,7 @@ module ActionController attr_accessor :permitted # :nodoc: # Returns a new instance of ActionController::Parameters. - # Also, sets the +permitted+ attribute to the default value of - # ActionController::Parameters.permit_all_parameters. + # Also, sets the +permitted+ attribute to +false+. # # class Person # include ActiveRecord::Base @@ -78,12 +64,6 @@ module ActionController # params = ActionController::Parameters.new(name: 'Francesco') # params.permitted? # => false # Person.new(params) # => ActiveModel::ForbiddenAttributesError - # - # ActionController::Parameters.permit_all_parameters = true - # - # params = ActionController::Parameters.new(name: 'Francesco') - # params.permitted? # => true - # Person.new(params) # => # def initialize(attributes = nil) super(attributes) @permitted = self.class.permit_all_parameters -- cgit v1.2.3