-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Psych::DisallowedClass (Tried to load unspecified class: Time): #604
Comments
I can allow see |
prolog: not sure why this is a closed issue, so this is just an observation (and a kind of band-aid to those who do not get the suggested fixes to work, or will not downgrade Psych I'm currently on Rails 8.0.0.alpha with ruby 3.2.2 [amd64-darwin22] - and with the "baked-in psych at 5.1.2, I experience the subject on this issue in full force when (trying to) serializing IceCube::Schedule objects like:
Like @azeemh I'm perfectly able to "downgrade" Psych to 3.3.4 -- not sure if I loose something important though
How can I have my 🍰 and eat it too? Well, at least with IceCube::Schedule you seem to be able to do the following (building upon the defined schedule from above)
epilog: I know - I'm using the |
I've just stumbled on this issue. Here are permalinks to Rails corresponding to when that comment was made:
edit: on the off chance it's useful to someone, my solution was to monkey patch it: module PaperTrail::Serializers::YAML
def yaml_column_permitted_classes
(super + [BigDecimal, Date, DateTime, Time]).uniq
end
end along with some assertions to make sure the monkey patch is still valid against the gem. |
ruby 3.2
rails 7.04
ubuntu 22.10 (shouldn't matter but i hate when people give mac specific solutions)
even with
gem 'psych', '~> 5.0.1'
in mygemfile
none of the following lines in my ror application.rb will work (i tried them one at a time but including all for completeness.)
please advise because now I have to pin to
gem 'psych', '~> 3.3.0'
in my gemfile which bundle gives me 3.3.4 and everything works.why did you guys forget to add support for dates and times? that's like the most basic thing and it broke everything.
please add symbols dates and times as default permitted classes in the gem, or please inform the relevant area (file and line in the codebase) so I or anyone else with the same issue can make a pull release that fixes if nobody else will?
thank you.
The text was updated successfully, but these errors were encountered: