Skip to content

Commit

Permalink
Rails 7.1: set up Active Record serialization
Browse files Browse the repository at this point in the history
Having added encryption changes, other specs (HistoricalEvent being one
began failing due to initialization order. Prior to 7.1, YAML was the
default serializer for calls like `serialize :new_value`.

Set a global YAML default to preserve behaviour.
  • Loading branch information
rgarner committed Feb 6, 2025
1 parent 8d05e46 commit c5cf80c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class Application < Rails::Application

config.active_job.queue_adapter = :sidekiq

# Set up YAML as the default serializer from Rails 7.1
config.active_record.default_column_serializer = YAML

config.active_record.yaml_column_permitted_classes = [
ActiveSupport::TimeWithZone,
ActiveSupport::TimeZone,
Expand Down

0 comments on commit c5cf80c

Please sign in to comment.