diff --git a/core/app/models/spree/preference.rb b/core/app/models/spree/preference.rb index ec03f9ef9c5..52c927d4153 100644 --- a/core/app/models/spree/preference.rb +++ b/core/app/models/spree/preference.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Spree::Preference < Spree::Base - serialize :value + serialize :value, coder: YAML validates :key, presence: true, uniqueness: { allow_blank: true, case_sensitive: true } end diff --git a/core/app/models/spree/return_item.rb b/core/app/models/spree/return_item.rb index 144bca5dccb..5aee0ee53ad 100644 --- a/core/app/models/spree/return_item.rb +++ b/core/app/models/spree/return_item.rb @@ -67,7 +67,7 @@ class ReturnItem < Spree::Base scope :exchange_processed, -> { where.not(exchange_inventory_unit: nil) } scope :exchange_required, -> { exchange_requested.where(exchange_inventory_unit: nil) } - serialize :acceptance_status_errors + serialize :acceptance_status_errors, coder: YAML delegate :eligible_for_return?, :requires_manual_intervention?, to: :validator delegate :variant, to: :inventory_unit diff --git a/core/lib/spree/preferences/persistable.rb b/core/lib/spree/preferences/persistable.rb index 12eff53f93e..9943c0f8ded 100644 --- a/core/lib/spree/preferences/persistable.rb +++ b/core/lib/spree/preferences/persistable.rb @@ -7,7 +7,7 @@ module Persistable included do include Spree::Preferences::Preferable - serialize :preferences, Hash + serialize :preferences, Hash, coder: YAML after_initialize :initialize_preference_defaults end