mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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) }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
module Spree
|
||||
class Preference < ApplicationRecord
|
||||
serialize :value
|
||||
|
||||
serialize :value, coder: YAML
|
||||
validates :key, presence: true
|
||||
validates :value_type, presence: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user