Skip to content

Commit

Permalink
Specifiy coder for serialize attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterberkenbosch committed Aug 26, 2023
1 parent 7f91e0e commit 42fac2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/app/models/spree/preference.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion core/app/models/spree/return_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/lib/spree/preferences/persistable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 42fac2a

Please sign in to comment.