From 5ca3a4afe1c6e6a90ddf002dbdb5bedf84f29704 Mon Sep 17 00:00:00 2001 From: khiav reoy Date: Sat, 2 Sep 2023 23:53:00 +0800 Subject: [PATCH] Fix: Psych::DisallowedClass --- test/lib/seeds.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lib/seeds.rb b/test/lib/seeds.rb index f9a6669..6393561 100644 --- a/test/lib/seeds.rb +++ b/test/lib/seeds.rb @@ -23,6 +23,9 @@ require 'rails_compatibility/setup_autoload_paths' RailsCompatibility.setup_autoload_paths [File.expand_path('../models/', __FILE__)] +ActiveRecord::Base.use_yaml_unsafe_load = true if ActiveRecord::Base.method_defined?(:use_yaml_unsafe_load) # For Rails 5.2 +ActiveRecord.use_yaml_unsafe_load = true if ActiveRecord.respond_to?(:use_yaml_unsafe_load) # For Rails 7.0 + users = User.create([ { name: 'John', email: 'john@example.com' }, { name: 'Pearl', email: 'pearl@example.com', serialized_attribute: { testing: true, deep: { deep: :deep }}},