Sha256: 049d447122b3f938e1339a6182623c5f36514f24b71ccd03918f98e45249c9fb
Contents?: true
Size: 646 Bytes
Versions: 86
Compression:
Stored size: 646 Bytes
Contents
# frozen_string_literal: true module Spree class Promotion module Rules class Store < PromotionRule has_many :promotion_rule_stores, class_name: "Spree::PromotionRuleStore", foreign_key: :promotion_rule_id, dependent: :destroy has_many :stores, through: :promotion_rule_stores, class_name: "Spree::Store" def applicable?(promotable) promotable.is_a?(Spree::Order) end def eligible?(order, _options = {}) stores.none? || stores.include?(order.store) end end end end end
Version data entries
86 entries across 86 versions & 2 rubygems