From ade52dd07d2cbdf97cc5f5ab1212bf4db019d8cc Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 27 Feb 2020 17:40:32 +0000 Subject: [PATCH] Make ship methods services query work with rails 4, bool_or now results in a boolean and not in t or f as before --- app/models/spree/shipping_method_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/shipping_method_decorator.rb b/app/models/spree/shipping_method_decorator.rb index d79e2b6853..60f1976ed7 100644 --- a/app/models/spree/shipping_method_decorator.rb +++ b/app/models/spree/shipping_method_decorator.rb @@ -41,7 +41,7 @@ Spree::ShippingMethod.class_eval do select("distributor_id"). select("BOOL_OR(spree_shipping_methods.require_ship_address = 'f') AS pickup"). select("BOOL_OR(spree_shipping_methods.require_ship_address = 't') AS delivery"). - map { |sm| [sm.distributor_id.to_i, { pickup: sm.pickup == 't', delivery: sm.delivery == 't' }] } + map { |sm| [sm.distributor_id.to_i, { pickup: sm.pickup, delivery: sm.delivery }] } ] end