What `@format_to_json && true` means?
`@format_to_json` is boolean, so it should be written simply like `@format_to_json || record.has_key?(@field_ref)`.