We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edbe467 commit 0385029Copy full SHA for 0385029
activerecord/test/cases/serialized_attribute_test.rb
@@ -502,12 +502,13 @@ def test_decorated_type_with_decorator_block
502
klass = Class.new(ActiveRecord::Base) do
503
self.table_name = Topic.table_name
504
store :content, coder: ActiveRecord::Coders::JSON
505
- attribute(:content, EncryptedType.new(subtype: Topic.attribute_types.fetch("content")))
+ decorate_attributes([:content]) do |name, type|
506
+ EncryptedType.new(subtype: type)
507
+ end
508
end
509
510
topic = klass.create!(content: { trial: true })
-
- assert_equal({ trial: true }, topic.content)
511
+ assert_equal({ "trial" => true }, topic.content)
512
513
514
def test_mutation_detection_does_not_double_serialize
0 commit comments