Hello 👋
While using Oj I found out it was not able to handle circular references when ActiveSupport was loaded in rails mode. I was wondering if this was expected. I could not find a mention of this special case in the documentation at least.
require("bundler/inline")
gemfile do
source("https://rubygems.org")
gem("oj", "3.16.11")
gem("activesupport", "8.0.3")
end
require("oj")
require("active_support/all")
begin
a = []
b = []
a.push(b)
b.push(a)
Oj.dump(a, mode: :rails, circular: true)
puts("SUCCESS: handled circular reference with circular: true")
rescue SystemStackError
puts("ERROR: SystemStackError triggered because of circular reference")
end
Thanks a lot for any help you can give me 🙏