Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Replace `Float::INFINITY` with `BigDecimal::INFINITY` (#11588)
Damian Legawiec6c57940b4e75
diff --git a/core/app/finders/spree/products/find.rb b/core/app/finders/spree/products/find.rbindex d9e5a8417b..53309b0743 100644--- a/core/app/finders/spree/products/find.rb+++ b/core/app/finders/spree/products/find.rb@@ -257,7 +257,7 @@ module Spreedef map_prices(prices)prices.map do |price|- price == 'Infinity' ? Float::INFINITY : price.to_f+ price == 'Infinity' ? BigDecimal::INFINITY : price.to_fendenddiff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rbindex 853e731f97..7e4dd4e232 100644--- a/core/app/models/spree/product.rb+++ b/core/app/models/spree/product.rb@@ -302,7 +302,7 @@ module Spreedef total_on_hand@total_on_hand ||= Rails.cache.fetch(['product-total-on-hand', cache_key_with_version]) doif any_variants_not_track_inventory?- Float::INFINITY+ BigDecimal::INFINITYelsestock_items.sum(:count_on_hand)end@@ -338,6 +338,10 @@ module Spreeendend+ def digital?+ shipping_category == I18n.t('spree.seed.shipping.categories.digital')+ end+privatedef add_associations_from_prototypediff --git a/core/app/models/spree/stock/quantifier.rb b/core/app/models/spree/stock/quantifier.rbindex 69941c7cff..06a01770c7 100644--- a/core/app/models/spree/stock/quantifier.rb+++ b/core/app/models/spree/stock/quantifier.rb@@ -12,7 +12,7 @@ module Spree@total_on_hand ||= if variant.should_track_inventory?stock_items.sum(:count_on_hand)else- Float::INFINITY+ BigDecimal::INFINITYendenddiff --git a/core/lib/spree/core/search/base.rb b/core/lib/spree/core/search/base.rbindex 62ba3645d5..2f3c1bb3de 100644--- a/core/lib/spree/core/search/base.rb+++ b/core/lib/spree/core/search/base.rb@@ -101,7 +101,7 @@ module Spreehigh_price = Monetize.parse(price_param.remove("#{less_than_string} ")).to_ielselow_price, high_price = Monetize.parse_collection(price_param).map(&:to_i)- high_price = Float::INFINITY if high_price&.zero?+ high_price = BigDecimal::INFINITY if high_price&.zero?end"#{low_price},#{high_price}"