Selaa lähdekoodia

Merge pull request #36 from Shopify/fix_variant_price_range

Adds to_f to prices to get correct range.
Jason Normore 12 vuotta sitten
vanhempi
commit
181040014b
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      lib/shopify_api/resources/product.rb

+ 1 - 1
lib/shopify_api/resources/product.rb

@@ -5,7 +5,7 @@ module ShopifyAPI
 
     # compute the price range
     def price_range
-      prices = variants.collect(&:price)
+      prices = variants.collect(&:price).collect(&:to_f)
       format =  "%0.2f"
       if prices.min != prices.max
         "#{format % prices.min} - #{format % prices.max}"