FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow ActiveSupport::HashWithIndifferentAccess of yaml parse by llpereiras · Pull Request #757 · Dynamoid/dynamoid · GitHub

Allow ActiveSupport::HashWithIndifferentAccess of yaml parse - #757

Open
llpereiras wants to merge 1 commit into
Dynamoid:masterfrom
llpereiras:master
Open

Allow ActiveSupport::HashWithIndifferentAccess of yaml parse#757
llpereiras wants to merge 1 commit into
Dynamoid:masterfrom
llpereiras:master

Conversation

llpereiras commented Jun 6, 2024
edited
Loading

Copy link
Copy Markdown

The serialized field are stored with ActiveSupport

In my model, I added this:

  field :description, :serialized

when I read the record, I received this error:

Psych::DisallowedClass: Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess

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.

Copy link
Copy Markdown
Member

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL