mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #18003 from sikachu/permit_all_parameters-thread-safety
Make AC::Params.permit_all_parameters thread safe
This commit is contained in:
parent
c261d7cd14
commit
da5cc10e94
1 changed files with 10 additions and 1 deletions
|
@ -100,7 +100,6 @@ module ActionController
|
|||
# params[:key] # => "value"
|
||||
# params["key"] # => "value"
|
||||
class Parameters < ActiveSupport::HashWithIndifferentAccess
|
||||
cattr_accessor :permit_all_parameters, instance_accessor: false
|
||||
cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false
|
||||
|
||||
# By default, never raise an UnpermittedParameters exception if these
|
||||
|
@ -123,6 +122,16 @@ module ActionController
|
|||
always_permitted_parameters
|
||||
end
|
||||
|
||||
# Returns the value of +permit_all_parameters+.
|
||||
def self.permit_all_parameters
|
||||
Thread.current[:action_controller_permit_all_parameters]
|
||||
end
|
||||
|
||||
# Sets the value of +permit_all_parameters+.
|
||||
def self.permit_all_parameters=(value)
|
||||
Thread.current[:action_controller_permit_all_parameters] = value
|
||||
end
|
||||
|
||||
# Returns a new instance of <tt>ActionController::Parameters</tt>.
|
||||
# Also, sets the +permitted+ attribute to the default value of
|
||||
# <tt>ActionController::Parameters.permit_all_parameters</tt>.
|
||||
|
|
Loading…
Reference in a new issue