From 0ca86344d2d03e1afa3e9d6292c84a4ab51a4c47 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:35:29 +0000 Subject: [PATCH] Update use of deprecated #add_tab method to #add_metadata --- app/controllers/spree/admin/products_controller.rb | 8 ++++---- app/models/spree/order.rb | 6 +++--- app/services/sets/product_set.rb | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index 17d4487560..1674748bb5 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -227,10 +227,10 @@ module Spree def notify_bugsnag(error, product, variant) Bugsnag.notify(error) do |report| - report.add_tab(:product, product.attributes) - report.add_tab(:product_error, product.errors.first) unless product.valid? - report.add_tab(:variant, variant.attributes) - report.add_tab(:variant_error, variant.errors.first) unless variant.valid? + report.add_metadata(:product, product.attributes) + report.add_metadata(:product_error, product.errors.first) unless product.valid? + report.add_metadata(:variant, variant.attributes) + report.add_metadata(:variant_error, variant.errors.first) unless variant.valid? end end diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 53172c01d9..d5e3008576 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -540,9 +540,9 @@ module Spree # And the shipping fee is already up-to-date when this error occurs. # https://github.com/openfoodfoundation/openfoodnetwork/issues/3924 Bugsnag.notify(e) do |report| - report.add_tab(:order, attributes) - report.add_tab(:shipment, shipment.attributes) - report.add_tab(:shipment_in_db, Spree::Shipment.find_by(id: shipment.id).attributes) + report.add_metadata(:order, attributes) + report.add_metadata(:shipment, shipment.attributes) + report.add_metadata(:shipment_in_db, Spree::Shipment.find_by(id: shipment.id).attributes) end end diff --git a/app/services/sets/product_set.rb b/app/services/sets/product_set.rb index 1928c835e6..4446120aea 100644 --- a/app/services/sets/product_set.rb +++ b/app/services/sets/product_set.rb @@ -132,11 +132,11 @@ module Sets def notify_bugsnag(error, product, variant, variant_attributes) Bugsnag.notify(error) do |report| - report.add_tab(:product, product.attributes) - report.add_tab(:product_error, product.errors.first) unless product.valid? - report.add_tab(:variant_attributes, variant_attributes) - report.add_tab(:variant, variant.attributes) - report.add_tab(:variant_error, variant.errors.first) unless variant.valid? + report.add_metadata(:product, product.attributes) + report.add_metadata(:product_error, product.errors.first) unless product.valid? + report.add_metadata(:variant_attributes, variant_attributes) + report.add_metadata(:variant, variant.attributes) + report.add_metadata(:variant_error, variant.errors.first) unless variant.valid? end end