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.

Fixed syntax for Rails 6.1

Damian Legawiec60edd98e98b4
diff --git a/core/app/models/spree/promotion.rb b/core/app/models/spree/promotion.rb
index 4e3377ac97..79bf3d9bfa 100644
--- a/core/app/models/spree/promotion.rb
+++ b/core/app/models/spree/promotion.rb
@@ -22,7 +22,11 @@ module Spree
#
# Enums
#
- enum :kind, { coupon_code: 0, automatic: 1 }
+ if Rails.version >= '7.0'
+ enum :kind, { coupon_code: 0, automatic: 1 }
+ else
+ enum kind: { coupon_code: 0, automatic: 1 }
+ end
#
# Associations