lib/active_support/json/encoding.rb in activesupport-6.0.6.1 vs lib/active_support/json/encoding.rb in activesupport-6.1.0.rc1
- old
+ new
@@ -91,10 +91,14 @@
when String
EscapedString.new(value)
when Numeric, NilClass, TrueClass, FalseClass
value.as_json
when Hash
- Hash[value.map { |k, v| [jsonify(k), jsonify(v)] }]
+ result = {}
+ value.each do |k, v|
+ result[jsonify(k)] = jsonify(v)
+ end
+ result
when Array
value.map { |v| jsonify(v) }
else
jsonify value.as_json
end