add bugsnag alert

This commit is contained in:
Andy Brett
2021-02-21 22:27:58 -08:00
parent dec6d2189f
commit 5dcda317d2

View File

@@ -300,6 +300,7 @@ module Spree
end
def ensure_unit_value
Bugsnag.notify("Trying to set unit_value to NaN") if unit_value&.nan?
return unless (product&.variant_unit == "items" && unit_value.nil?) || unit_value&.nan?
self.unit_value = 1.0