address deprecation warning

This commit is contained in:
Andy Brett
2021-06-29 08:36:34 -07:00
parent 07a2a584c3
commit e24d2e5077
3 changed files with 5 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ class Customer < ApplicationRecord
def check_for_orders
return true unless orders.any?
errors[:base] << I18n.t('admin.customers.destroy.has_associated_orders')
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_orders'))
throw :abort
end
end

View File

@@ -114,7 +114,7 @@ module Spree
def at_least_one_shipping_category
return unless shipping_categories.empty?
errors[:base] << "You need to select at least one shipping category"
errors.add(:base, "You need to select at least one shipping category")
end
def touch_distributors

View File

@@ -46,9 +46,9 @@ module Spree
variant = line_item.variant
display_name = variant.name.to_s
display_name += %{(#{variant.options_text})} if variant.options_text.present?
line_item.errors[:quantity] << Spree.t(:out_of_stock,
scope: :order_populator,
item: display_name.inspect)
line_item.errors.add(:quantity, Spree.t(:out_of_stock,
scope: :order_populator,
item: display_name.inspect))
end
end
end