Class: SpreeCmCommissioner::Promotion::Rules::Customers

Inherits:
Spree::PromotionRule
  • Object
show all
Defined in:
app/models/spree_cm_commissioner/promotion/rules/customers.rb

Instance Method Summary collapse

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_stringObject



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, _options = {})
  customers.include?(order.customer)
end