Class: Spree::PromotionAdvertiser

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/promotion_advertiser.rb

Class Method Summary collapse

Class Method Details

.for_product(product) ⇒ Object



5
6
7
8
# File 'app/models/spree/promotion_advertiser.rb', line 5

def self.for_product(product)
  promotion_ids = product.promotion_rules.map(&:promotion_id).uniq
  Spree::Promotion.advertised.where(id: promotion_ids).reject(&:inactive?)
end