Class: SpreeCmCommissioner::Promotion::Rules::Customers
- Inherits:
-
Spree::PromotionRule
- Object
- Spree::PromotionRule
- SpreeCmCommissioner::Promotion::Rules::Customers
- Defined in:
- app/models/spree_cm_commissioner/promotion/rules/customers.rb
Instance Method Summary collapse
- #applicable?(promotable) ⇒ Boolean
- #customer_ids_string ⇒ Object
- #customer_ids_string=(value) ⇒ Object
- #eligible?(order, _options = {}) ⇒ Boolean
Instance Method Details
#applicable?(promotable) ⇒ Boolean
12 13 14 |
# File 'app/models/spree_cm_commissioner/promotion/rules/customers.rb', line 12 def applicable?(promotable) promotable.is_a?(SpreeCmCommissioner::Customer) end |
#customer_ids_string ⇒ Object
20 21 22 |
# File 'app/models/spree_cm_commissioner/promotion/rules/customers.rb', line 20 def customer_ids_string customer_ids.join(',') end |
#customer_ids_string=(value) ⇒ Object
24 25 26 27 |
# File 'app/models/spree_cm_commissioner/promotion/rules/customers.rb', line 24 def customer_ids_string=(value) # check this self.customer_ids = value end |
#eligible?(order, _options = {}) ⇒ Boolean
16 17 18 |
# File 'app/models/spree_cm_commissioner/promotion/rules/customers.rb', line 16 def eligible?(order, = {}) customers.include?(order.customer) end |