Sha256: 3ec615239e171caa96d6d75a76091967719262f1e3ff3e0882d4cba8c20bfb1f
Contents?: true
Size: 444 Bytes
Versions: 26
Compression:
Stored size: 444 Bytes
Contents
module Spree class OrderPromotion < Spree::Base belongs_to :order, class_name: 'Spree::Order' belongs_to :promotion, class_name: 'Spree::Promotion' delegate :name, :description, :code, :public_metadata, to: :promotion delegate :currency, to: :order extend Spree::DisplayMoney money_methods :amount def amount order.all_adjustments.promotion.where(source: promotion.actions).sum(:amount) end end end
Version data entries
26 entries across 26 versions & 1 rubygems