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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Added handy scopes to Price model - `with_currency`, `non_zero, and `discounted`
Damian Legawiec396d219b47ba
diff --git a/core/app/models/spree/price.rb b/core/app/models/spree/price.rbindex aea81da737..9495372149 100644--- a/core/app/models/spree/price.rb+++ b/core/app/models/spree/price.rb@@ -23,6 +23,10 @@ module Spreeless_than_or_equal_to: MAXIMUM_AMOUNT}+ scope :with_currency, ->(currency) { where(currency: currency) }+ scope :non_zero, -> { where.not(amount: [nil, 0]) }+ scope :discounted, -> { where('compare_at_amount > amount') }+extend DisplayMoneymoney_methods :amount, :price, :compare_at_amountalias display_compare_at_price display_compare_at_amount