mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
address deprecation warning
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user