mirror of https://github.com/rails/rails
Revert "Merge pull request #50489 from maniSHarma7575/50481-fix-activesupport-json-encode"
This reverts commit7b9e9ee244
, reversing changes made to590a675c4e
. Reason: https://github.com/rails/rails/pull/50489#issuecomment-2123881327
This commit is contained in:
parent
26f8edf411
commit
c0a2b28038
|
@ -76,13 +76,7 @@ module ActiveSupport
|
|||
when Hash
|
||||
result = {}
|
||||
value.each do |k, v|
|
||||
unless String === k
|
||||
k = if Symbol === k
|
||||
k.name
|
||||
else
|
||||
k.to_s
|
||||
end
|
||||
end
|
||||
k = k.to_s unless Symbol === k || String === k
|
||||
result[k] = jsonify(v)
|
||||
end
|
||||
result
|
||||
|
|
|
@ -81,8 +81,7 @@ module JSONTest
|
|||
[ [1, "a", :b, nil, false], %([1,\"a\",\"b\",null,false]) ]]
|
||||
|
||||
HashTests = [[ { foo: "bar" }, %({\"foo\":\"bar\"}) ],
|
||||
[ { 1 => 1, 2 => "a", 3 => :b, 4 => nil, 5 => false }, %({\"1\":1,\"2\":\"a\",\"3\":\"b\",\"4\":null,\"5\":false}) ],
|
||||
[ { "a" => 1, :a => 2, :c => { "b" => 3, :b => 4 } }, %({\"a\":2,\"c\":{\"b\":4}}) ]]
|
||||
[ { 1 => 1, 2 => "a", 3 => :b, 4 => nil, 5 => false }, %({\"1\":1,\"2\":\"a\",\"3\":\"b\",\"4\":null,\"5\":false}) ]]
|
||||
|
||||
RangeTests = [[ 1..2, %("1..2")],
|
||||
[ 1...2, %("1...2")],
|
||||
|
|
Loading…
Reference in New Issue