Spree 1.1.2 compat. Adding specs for digital shipping

This commit is contained in:
Michael Bianco
2012-07-09 13:32:45 -04:00
parent cdbc636e79
commit 95e9b97abe
5 changed files with 42 additions and 6 deletions
+2 -1
View File
@@ -10,12 +10,13 @@ Spree::Order.class_eval do
false
end
# UPGRADE_CHECK
# TODO this works as of spree 1.1.1; make sure to check the original function on upgrade
def available_shipping_methods(display_on = nil)
return [] unless ship_address
all_methods = Spree::ShippingMethod.all_available(self, display_on)
puts "ALL METHODS #{all_methods.count} #{display_on}"
if self.digital?
all_methods.detect { |m| m.calculator.class == Spree::Calculator::DigitalDelivery }.try { |d| [d] } || all_methods
else