Sha256: c08f289547e7940f26fe2e97a0313513b861d3f477a46945f6ea99a4954ed640
Contents?: true
Size: 349 Bytes
Versions: 5
Compression:
Stored size: 349 Bytes
Contents
# A rule to limit a promotion to a specific user. class Promotion::Rules::ItemTotal < PromotionRule preference :amount, :decimal, :default => 100.00 preference :operator, :string, :default => '>' OPERATORS = ['gt', 'gte'] def eligible?(order) order.item_total.send(preferred_operator == 'gte' ? :>= : :>, preferred_amount) end end
Version data entries
5 entries across 5 versions & 1 rubygems