You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version 2.19.0 causes an infinite loop with the LTS version of activesupport 4.2.11.40 #950
I realize we are still on an older version of Rails 4 and we are actively converting it to go to a newer version.
In the meantime, just want to point out going from 2.18.1 to 2.19.0 caused an infinite loop when using the #to_json method.
Currently, we are just using != '2.19.0' in the Gemfile in hopes that this will be addressed, but realize that such an older version may not constitute a fix. Just for reference there is no problem when using it with Rails 5 LTS.
No problem. Thanks for the help. I figured this might be an issue for Rails LTS versions rather than for json since yours works with the last official release. Since Rails LTS are the ones that have extended the last supported version of Rails 4.2, I'll try to reach out to them.
thanks again.
I was double checking a few things, and found a script that will easily create the problem, but requires going back to ruby 2.7
Rails LTS supports allows ruby 3+ with the newer versions of BigDecimal, but going back to ruby 2.7 and I can still create the same problem.
We are actively trying to go to Rails 5, so we can easily just lock it to < 2.19 for now.
I guess at this point, this is just for context if you decide you want to fix it or not.
Activity
byroot commentedon Mar 6, 2026
It's likely a consequence of #941
I can't promise I can fix it, but I'd appreciate if you could provide a reproduction script so I can investigate the feasibility of fixing it.
byroot commentedon Mar 6, 2026
I tried to repro with the little information available, but no luck:
So until I get a repro script or at least some more details, my hands are tied.
rwadstein commentedon Mar 9, 2026
No problem. Thanks for the help. I figured this might be an issue for Rails LTS versions rather than for
jsonsince yours works with the last official release. Since Rails LTS are the ones that have extended the last supported version of Rails 4.2, I'll try to reach out to them.thanks again.
rwadstein commentedon Mar 9, 2026
I was double checking a few things, and found a script that will easily create the problem, but requires going back to ruby 2.7
Rails LTS supports allows ruby 3+ with the newer versions of BigDecimal, but going back to ruby 2.7 and I can still create the same problem.
rwadstein commentedon Mar 9, 2026
We are actively trying to go to Rails 5, so we can easily just lock it to
< 2.19for now.I guess at this point, this is just for context if you decide you want to fix it or not.
byroot commentedon Mar 9, 2026
Ok I see. I'm afraid I can't fix that, except by reverting what I believe to be an important improvement.
Rails 4.x is tightly coupled to
to_jsonmethods being defined on specific classes.You can monkey patch to fix the problem though:
Sorry, I can't do any better than that.