Class: Spree::Promotion::Rules::User

Inherits:
Spree::PromotionRule show all
Defined in:
app/models/spree/promotion/rules/user.rb

Instance Method Summary collapse

Instance Method Details

#eligible?(order, options = {}) ⇒ Boolean


13
14
15
# File 'app/models/spree/promotion/rules/user.rb', line 13

def eligible?(order, options = {})
  users.include?(order.user)
end

#user_ids_stringObject


17
18
19
# File 'app/models/spree/promotion/rules/user.rb', line 17

def user_ids_string
  user_ids.join(',')
end

#user_ids_string=(s) ⇒ Object


21
22
23
# File 'app/models/spree/promotion/rules/user.rb', line 21

def user_ids_string=(s)
  self.user_ids = s.to_s.split(',').map(&:strip)
end