You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering the same error when creating a flat rate calculator for my Shipping Method. In addition I am encountering it when trying to add a flat rate Action to my promotion
Psych::DisallowedClass in Spree::Admin::PromotionsController#update
Encountered when trying to create a flat rate calculator in the Admin namespace.
As I have another project using the spree_backend gem without this issue, I'm reporting it here.
Context
This is a fresh spree_rails_frontend install (4.8.0). On a local machine using Rbenv.
Expected Behavior
Calculator is saved.
Actual Behavior
Psych::DisallowedClass in Spree::Admin::ShippingMethodsController#update
Tried to dump unspecified class: BigDecimal
/.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:571:in
accept' /.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:331:in
block in visit_Hash'/.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:329:in
each' /.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:329:in
visit_Hash'/.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:135:in
accept' /.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:574:in
accept'/.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych/visitors/yaml_tree.rb:117:in
push' /.rbenv/versions/3.3.0/lib/ruby/3.3.0/psych.rb:585:in
safe_dump'activerecord (7.1.3.4) lib/active_record/coders/yaml_column.rb:19:in `dump'
Possible Fix
Ensure class is permitted.
Add:
config.active_record.yaml_column_permitted_classes << BigDecimal
Reference:
rails/rails#45826
https://stackoverflow.com/questions/74312283/tried-to-load-unspecified-class-activesupporttimewithzone-psychdisallowed
The text was updated successfully, but these errors were encountered: