Open llpereiras opened 4 months ago
I agree that it would be convenient to allow serialising such classes like HashWithIndifferentAccess
. So the only missing thing in the PR is specs for the new feature. Could you please add them?
But TBH I like mentioned above config option yaml_column_permitted_classes
. And use_yaml_unsafe_load
could also be useful or at least convenient for developers that are familiar with ActiveRecord
. So I am open to adding them.
The serialized field are stored with ActiveSupport
In my model, I added this:
when I read the record, I received this error:
I think, the most of the apps use rails and ActiveSupport, so I think should be a good addiction to add the support of ActiveSupport
For the extra informattion, I doesn't use active record gem. Because of that, the configuration of active_record like this
config.active_record.use_yaml_unsafe_load
OR
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess]
doesn't work for me.