Skip to content

Commit

Permalink
add for every serialized attribute a coder
Browse files Browse the repository at this point in the history
  • Loading branch information
abdellani committed Feb 27, 2024
1 parent 0b93c1b commit 007e2c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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, type: Hash, coder: YAML
before_validation :serialize_order
after_create :cancel_previous_invoices
default_scope { order(created_at: :desc) }
Expand Down
2 changes: 1 addition & 1 deletion app/models/report_rendering_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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, type: Hash, coder: YAML
end
3 changes: 1 addition & 2 deletions app/models/spree/preference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

module Spree
class Preference < ApplicationRecord
serialize :value

serialize :value, coder: YAML
validates :key, presence: true
validates :value_type, presence: true

Expand Down

0 comments on commit 007e2c3

Please sign in to comment.