Sha256: cc73fca1395e30fec9a0f3a87c7a2425cf11d17e0f0bbbfeaa37b5a16505c2e8
Contents?: true
Size: 490 Bytes
Versions: 133
Compression:
Stored size: 490 Bytes
Contents
# frozen_string_literal: true module Spree module PromotionHandler class Page attr_reader :order, :path def initialize(order, path) @order = order @path = path.gsub(/\A\//, '') end def activate if promotion && promotion.eligible?(order) promotion.activate(order: order) end end private def promotion @promotion ||= Spree::Promotion.active.find_by(path: path) end end end end
Version data entries
133 entries across 133 versions & 2 rubygems