Open vojtad opened 1 year ago
Thanks for the patch, it looks good to me 👍🏻 In what way is this a breaking change?
If you have attribute :avatar_data, :json
defined in your model then avatar_data
returned a String
and you could call JSON.parse
on it to get an object before.
With this patch avatar_data
returns an object without any need for deserializing it because it never gets serialized since the attribute is a JSON attribute.
Use
type_for_attribute
instead ofcolumns_hash
to check whether an attribute type is JSON or JSONB. Serialization is now skipped not only for database attributes but also for attributes defined using Attributes API.This is a breaking change. Do you want to hide it behind a feature flag or how should I approach this?