Hello,
Is there anyone here who knows how ActiveSupport::JSON::Encoding works? I have been trying to check issue https://github.com/rails/rails/issues/11460, but I am getting confused in all the times the encoder goes through the values. I think that it is too convoluted to what it intends to do, with the use_options flags and the encode_json and as_json methods in the core classes. Is someone here familiarized with that code to give me some help in fixing this issue? I have created a test that breaks with a SystemStackError:
def test_exception_raised_when_encoding_circular_reference_in_hash_inside_object
a = {}
b = Foo.new(a, nil)
a[“a”] = b
assert_raise(ActiveSupport::JSON::Encoding::CircularReferenceError) { ActiveSupport::JSON.encode(a) }
end
Best regards,