diff --git a/lib/audited/audit.rb b/lib/audited/audit.rb index 4d7d9082..eb92f327 100644 --- a/lib/audited/audit.rb +++ b/lib/audited/audit.rb @@ -60,8 +60,18 @@ def self.audited_classes end if Rails.gem_version >= Gem::Version.new("7.1") + def self.inherited(subclass) + super + subclass.serialize :audited_changes, coder: YAMLIfTextColumnType.new(subclass) + end + serialize :audited_changes, coder: YAMLIfTextColumnType.new(self) else + def self.inherited(subclass) + super + subclass.serialize :audited_changes, YAMLIfTextColumnType.new(subclass) + end + serialize :audited_changes, YAMLIfTextColumnType.new(self) end