diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-04 11:45:53 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-04 11:45:53 -0700 |
commit | 1ce0cc0d38c9f5058cb484612fab625db823c4e4 (patch) | |
tree | 7c856d0c2f6534c349ff2e81a01046acaa868c31 /actionpack/lib/action_controller | |
parent | 3f7e482aed8f67137c6c8382f6c558d7e856b341 (diff) | |
parent | b8f586a094c104006d29a87fee0d8b48d0af2d14 (diff) | |
download | rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.tar.gz rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.tar.bz2 rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.zip |
Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
For our build, stick with mail 2.5.x for now
Correct result, previously showing wrong result
Collapse PG default extractoin of most types to single regex
Change wording of explanation about precision & scale of decimal numbers [ci skip]
Cleaned up duplicated CHANGELOG entry [ci skip]
reuse available belongs_to? method
Convert StrongParameters cache to a hash. This fixes an unbounded memory leak demonstrated on @tenderlove's latest blog post:
Partially revert deprecation of *_filter
Pluralize params
Add default_i18n_subject to the guides
Fix regression on eager loading association based on SQL query rather than existing column.
Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4
Keep column defaults in type cast form
Return a null column when no column exists for an attribute
Refactor XML serializer to not depend on `serialized_attributes`
Test the serialized types of virtual columns in XML
implement ActiveRecord::Base#pretty_print + changelog
Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index d86d49c9dc..265048a308 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -130,7 +130,7 @@ module ActionController # looping in the common use case permit + mass-assignment. Defined in a # method to instantiate it only if needed. def converted_arrays - @converted_arrays ||= Set.new + @converted_arrays ||= {} end # Returns +true+ if the parameter is permitted, +false+ otherwise. @@ -333,15 +333,15 @@ module ActionController private def convert_hashes_to_parameters(key, value, assign_if_converted=true) - converted = convert_value_to_parameters(value) + converted = convert_value_to_parameters(key, value) self[key] = converted if assign_if_converted && !converted.equal?(value) converted end - def convert_value_to_parameters(value) - if value.is_a?(Array) && !converted_arrays.member?(value) - converted = value.map { |_| convert_value_to_parameters(_) } - converted_arrays << converted + def convert_value_to_parameters(key, value) + if value.is_a?(Array) && !converted_arrays.member?(key) + converted = value.map { |v| convert_value_to_parameters(nil, v) } + converted_arrays[key] = converted if key converted elsif value.is_a?(Parameters) || !value.is_a?(Hash) value |