add for every serialized attribute a coder

This commit is contained in:
Mohamed ABDELLANI
2024-02-27 18:19:42 +01:00
parent 0b93c1b92b
commit ca13b0154c
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