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,

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to