Class: Spree::Promotion::Rules::UserLoggedIn

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

Instance Method Summary collapse

Methods inherited from Spree::PromotionRule

for

Instance Method Details

#applicable?(promotable) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'app/models/spree/promotion/rules/user_logged_in.rb', line 5

def applicable?(promotable)
  promotable.is_a?(Spree::Order)
end

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

Returns:

  • (Boolean)


9
10
11
# File 'app/models/spree/promotion/rules/user_logged_in.rb', line 9

def eligible?(order, options = {})
  return order.user.present?
end