From 9f6c6672f53b8322502c17b630c0830f57acadee Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Fri, 22 Dec 2023 11:43:02 +0100 Subject: [PATCH] add coder to Invoice.data serializer --- app/models/invoice.rb | 2 +- config/application.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 55524521b28f..55a8a18e4287 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -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) } diff --git a/config/application.rb b/config/application.rb index 391cad58b526..a8a3423b53e3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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