From 8ac1368ef228a8367845eaad21900401e8bf69f9 Mon Sep 17 00:00:00 2001 From: Tanmay Khandelwal Date: Mon, 26 May 2014 14:11:20 +0530 Subject: [PATCH] class:Order add_variant methods 'current_item' is now an instance of 'variant' instead of truthy/falsy values. Issue: https://github.com/jsqu99/spree_flexi_variants/issues/99. --- app/models/spree/order_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index e33e7a6..08b5567 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -1,7 +1,7 @@ module Spree Order.class_eval do def add_variant(variant, quantity = 1, ad_hoc_option_value_ids=[], product_customizations=[]) - current_item = contains?(variant, ad_hoc_option_value_ids, product_customizations) + current_item = find_line_item_by_variant(variant, ad_hoc_option_value_ids, product_customizations) if current_item current_item.quantity += quantity current_item.save