Skip to content

Commit

Permalink
add coder to Invoice.data serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
abdellani committed Dec 22, 2023
1 parent 6d5acda commit 9f6c667
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ module ::Reporting; end
config.action_view.form_with_generates_remote_forms = false
config.active_record.cache_versioning = false
config.active_record.has_many_inversing = false
config.active_record.yaml_column_permitted_classes = [BigDecimal, Symbol]
config.active_record.yaml_column_permitted_classes = [BigDecimal, Symbol, ActiveSupport::SafeBuffer]

config.active_support.escape_html_entities_in_json = true

Expand Down

0 comments on commit 9f6c667

Please sign in to comment.