Skip to content

Commit

Permalink
does this work ?
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoodrow authored Nov 12, 2023
1 parent 7d8a970 commit 3b569e1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/patches/active_record/rails7_1/serialization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,7 @@ def serialize(attr_name, class_name_or_coder = Object, **options)

super(attr_name, **options)

coder = if options[:coder] == ::JSON
::ActiveRecord::Coders::JSON
elsif options.key?(:coder)
if coder.respond_to?(:new) && !coder.respond_to?(:load)
coder.new(attr_name, type)
else
options[:coder]
end
else
::ActiveRecord::Coders::YAMLColumn.new(attr_name, options[:type], **(options.fetch(:yaml, {})))
end
coder = build_column_serializer(attr_name, options[:coder], options[:type], options[:yaml])

self.globalize_serialized_attributes = globalize_serialized_attributes.dup
self.globalize_serialized_attributes[attr_name] = coder
Expand Down

0 comments on commit 3b569e1

Please sign in to comment.