Skip to content

Potential regression with bigdecimal_as_decimal #985

@calderhayes

Description

@calderhayes

Hello!

Upon updating our app from 3.16.12=>3.16.13 we noticed that some of our tests were failing. We were expecting a decimal value and instead received a string version of that decimal value.

We suspect that the update may have a regression which ignores some default options set in the initializer. Our json initializer looks like this:

require "oj"
require "active_support/json/encoding"

Oj.default_options = { mode: :compat, bigdecimal_as_decimal: true, safe: true }
Oj.optimize_rails

We serve this JSON using jbuilder if that makes a difference.

Do you think this is a bug? Is there a work around?

Thank you,

Calder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions