Skip to content

Commit

Permalink
Permit Symbol being serialized
Browse files Browse the repository at this point in the history
Rails decided to deem Symbol safe so we can too.

April reported not being able to update CMS pages.  I was able to reproduce in development environment.

```
Completed 500 Internal Server Error in 235ms (ActiveRecord: 46.5ms | Allocations: 89677)

Psych::DisallowedClass (Tried to load unspecified class: Symbol):

comfortable-mexican-sofa (456fb8507e96) app/controllers/comfy/admin/cms/pages_controller.rb:49:in `update'
```

Left breadcrumbs so that we can clean this up with patched version of Rails
  • Loading branch information
pgwillia committed Jul 20, 2022
1 parent 4071b1b commit ebbf6e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
# TODO: revisit config.active_record.yaml_column_permitted_classes when this gets bumped
gem 'rails', '~> 7.0.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
Expand Down
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ class Application < Rails::Application
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

# Rails decided to deem Symbol safe
# https://github.com/rails/rails/pull/45584
config.active_record.yaml_column_permitted_classes = [Symbol]
end
end

0 comments on commit ebbf6e6

Please sign in to comment.