Skip to content

armgit / spree

Public Imported from GitHub
0

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.

Fix .all? returns true on an empty array causing a false positive digital order.

Matthew Kennedy58270a494b67
diff --git a/core/app/models/spree/order/digital.rb b/core/app/models/spree/order/digital.rb
index 4b241fd802..f907131cd9 100644
--- a/core/app/models/spree/order/digital.rb
+++ b/core/app/models/spree/order/digital.rb
@@ -2,6 +2,8 @@ module Spree
class Order < Spree::Base
module Digital
def digital?
+ return if line_items.empty?
+
line_items.all?(&:digital?)
end