Class: ExampleAppPaperTrailChangesetTest

Inherits:
ActiveSupport::TestCase
  • Object
show all
Defined in:
lib/installer_templates/example_app_tests/test/models/example_app_paper_trail_changeset_test.rb

Overview

Regression: PaperTrail (>= 13) deserializes ‘versions.object_changes` via `YAML.safe_load`, using `ActiveRecord.yaml_column_permitted_classes` as the allow-list. Rails 7’s default is ‘[Symbol]`, so any update that touches `updated_at` (an `ActiveSupport::TimeWithZone`) raises `Psych::DisallowedClass` inside `version.changeset`, and PaperTrail rescues that into `{}`. The inline_forms versions list then renders every changeset as `empty`.

The installer ships ‘config/initializers/paper_trail_yaml_safe_load.rb`, which extends the allow-list. This test fails if that initializer is missing or insufficient.