Merge pull request #13944 from pavelk-lab/fix/rails-7-serialize-deprecation

Fix Rails 7.2 serialize deprecation warnings
This commit is contained in:
Rachel Arnould
2026-02-26 11:29:27 +01:00
committed by GitHub
4 changed files with 3 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ class Invoice < ApplicationRecord
self.belongs_to_required_by_default = false
belongs_to :order, class_name: 'Spree::Order'
serialize :data, Hash, coder: YAML
serialize :data, type: Hash, coder: YAML
before_validation :serialize_order
after_create :cancel_previous_invoices
default_scope { order(created_at: :desc) }

View File

@@ -4,5 +4,5 @@ class ReportRenderingOptions < ApplicationRecord
self.belongs_to_required_by_default = false
belongs_to :user, class_name: "Spree::User"
serialize :options, Hash, coder: YAML
serialize :options, type: Hash, coder: YAML
end

View File

@@ -74,8 +74,6 @@ Rails.application.configure do
allowed_warnings = [
# List strings here to allow matching deprecations.
#
"Passing the class as positional argument",
# Spree::CreditCard model aliases `cc_type` and has a method called `cc_type=` defined. Starting in Rails 7.2 `brand=` will not be calling `cc_type=` anymore. You may want to additionally define `brand=` to preserve the current behavior.
"model aliases",

View File

@@ -3,7 +3,7 @@ class UpdateItemNameToProductInOdReport < ActiveRecord::Migration[7.0]
self.belongs_to_required_by_default = false
belongs_to :user, class_name: "Spree::User"
serialize :options, Hash, coder: YAML
serialize :options, type: Hash, coder: YAML
end
# OD: Orders and Distributors