Merge pull request #12208 from abdellani/11673-add-a-coder-for-every-serialized-attribute

add for every serialized attribute a coder
This commit is contained in:
Filipe
2024-03-05 15:41:45 +00:00
committed by GitHub
3 changed files with 3 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ class Invoice < ApplicationRecord
self.belongs_to_required_by_default = false
belongs_to :order, class_name: 'Spree::Order'
serialize :data, Hash
serialize :data, Hash, coder: YAML
before_validation :serialize_order
after_create :cancel_previous_invoices
default_scope { order(created_at: :desc) }

View File

@@ -4,5 +4,5 @@ class ReportRenderingOptions < ApplicationRecord
self.belongs_to_required_by_default = false
belongs_to :user, class_name: "Spree::User"
serialize :options, Hash
serialize :options, Hash, coder: YAML
end

View File

@@ -2,8 +2,7 @@
module Spree
class Preference < ApplicationRecord
serialize :value
serialize :value, coder: YAML
validates :key, presence: true
validates :value_type, presence: true