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.
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
The
methodspart is no longer included, andcompany_and_codekey 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.