diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:51:43 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:51:43 +0200 |
commit | 628e51ff109334223094e30ad1365188bbd7f9c6 (patch) | |
tree | 6bf28936ffa0fb4fe2390b933958053daeffbc90 /actionpack/lib/action_controller/metal/strong_parameters.rb | |
parent | 4b6c68dfb810c836f87587a16353317d1a180805 (diff) | |
download | rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.gz rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.bz2 rails-628e51ff109334223094e30ad1365188bbd7f9c6.zip |
applies new string literal convention in actionpack/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'actionpack/lib/action_controller/metal/strong_parameters.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index f101c7b836..32ab8ca2ac 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -1,13 +1,13 @@ -require 'active_support/core_ext/hash/indifferent_access' -require 'active_support/core_ext/hash/transform_values' -require 'active_support/core_ext/array/wrap' -require 'active_support/core_ext/string/filters' -require 'active_support/rescuable' -require 'action_dispatch/http/upload' -require 'rack/test' -require 'stringio' -require 'set' -require 'yaml' +require "active_support/core_ext/hash/indifferent_access" +require "active_support/core_ext/hash/transform_values" +require "active_support/core_ext/array/wrap" +require "active_support/core_ext/string/filters" +require "active_support/rescuable" +require "action_dispatch/http/upload" +require "rack/test" +require "stringio" +require "set" +require "yaml" module ActionController # Raised when a required parameter is missing. @@ -596,26 +596,26 @@ module ActionController # Wire up YAML format compatibility with Rails 4.2 and Psych 2.0.8 and 2.0.9+. # Makes the YAML parser call `init_with` when it encounters the keys below # instead of trying its own parsing routines. - YAML.load_tags['!ruby/hash-with-ivars:ActionController::Parameters'] = name - YAML.load_tags['!ruby/hash:ActionController::Parameters'] = name + YAML.load_tags["!ruby/hash-with-ivars:ActionController::Parameters"] = name + YAML.load_tags["!ruby/hash:ActionController::Parameters"] = name end hook_into_yaml_loading def init_with(coder) # :nodoc: case coder.tag - when '!ruby/hash:ActionController::Parameters' + when "!ruby/hash:ActionController::Parameters" # YAML 2.0.8's format where hash instance variables weren't stored. @parameters = coder.map.with_indifferent_access @permitted = false - when '!ruby/hash-with-ivars:ActionController::Parameters' + when "!ruby/hash-with-ivars:ActionController::Parameters" # YAML 2.0.9's Hash subclass format where keys and values # were stored under an elements hash and `permitted` within an ivars hash. - @parameters = coder.map['elements'].with_indifferent_access - @permitted = coder.map['ivars'][:@permitted] - when '!ruby/object:ActionController::Parameters' + @parameters = coder.map["elements"].with_indifferent_access + @permitted = coder.map["ivars"][:@permitted] + when "!ruby/object:ActionController::Parameters" # YAML's Object format. Only needed because of the format # backwardscompability above, otherwise equivalent to YAML's initialization. - @parameters, @permitted = coder.map['parameters'], coder.map['permitted'] + @parameters, @permitted = coder.map["parameters"], coder.map["permitted"] end end |