Sha256: fdb305ff8449efffcb03c01a76c74a0426f503cf7a80cc614a4aaa6fb071c5d8
Contents?: true
Size: 484 Bytes
Versions: 33
Compression:
Stored size: 484 Bytes
Contents
module Spree module PromotionHandler class Page attr_reader :order, :path, :store def initialize(order, path) @order = order @store = order.store @path = path.gsub(/\A\//, '') end def activate if promotion&.eligible?(order) promotion.activate(order: order) end end private def promotion @promotion ||= store.promotions.active.find_by(path: path) end end end end
Version data entries
33 entries across 33 versions & 1 rubygems