Allie Coleman 6/25/2022

Dumping Data as JSON and Field Deprecation in Active Record

Read Original

The article details a technical issue encountered when deprecating a field in an ActiveRecord model. While overriding as_json to exclude the deprecated field works for the model itself, it fails when the model is included as an association in another model's JSON output. The post provides the specific code problem and the solution: explicitly excluding the field in the include option.

Dumping Data as JSON and Field Deprecation in Active Record

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week