Skip to content

v3.16.17 unexpected changes #1008

@Epigene

Description

@Epigene

Hi, I just upgraded Oj from v3.16.16 to v3.16.17 and some of json-response actions in our Rails app no longer return expected data.
We're setting Oj.optimize_rails.

For example

render json: collection.to_json(only: [:id, :code], methods: %i[company_and_code])

The methods part is no longer included, and company_and_code key is absent.

Any suggestions about how to fix this?

I should mention changing the action code to render json: collection.as_json(only: [:id, :code], methods: %i[company_and_code]) returns the expected data, but I can't be expected to dig through the many actions we have.

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