coinbase / coinbase/temporal-ruby
Rails app: NoMemoryError: Too deeply nested
- Dominant language
- Ruby
- Stars
- 287
- Forks
- 113
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 1
Description
When using Ruby on Rails I'm running into ["NoMemoryError: Too deeply nested."](https://github.com/ohler55/oj/issues/325) with OJ's serialization within this gem. The suggested solution worked if I edited the OJ 'mode' to 'compat' and added the 'use_as_json' flag as follows:
```
OJ_OPTIONS = {
mode: :compat,
# use ruby's built-in serialization. If nil, OJ seems to default to ~15 decimal places of precision
float_precision: 0,
use_as_json: true
}.freeze
```
The fact that no one else runs into this makes me wonder if maybe there is something about Rails specifically that is causing this though haven't tracked it down. If it's possible to modify these OJ options for everyone and tests still pass it could be suggested as a solution.
I'm happy to offer a PR if it would be accepted.
Contributor guide
Assessment
This issue has not been assessed yet.