Class: SolidusFriendlyPromotions::Conditions::NthOrder
- Inherits:
-
SolidusFriendlyPromotions::Condition
- Object
- Spree::Base
- SolidusFriendlyPromotions::Condition
- SolidusFriendlyPromotions::Conditions::NthOrder
- Includes:
- OrderLevelCondition
- Defined in:
- app/models/solidus_friendly_promotions/conditions/nth_order.rb
Instance Method Summary collapse
-
#eligible?(order, _options = {}) ⇒ Boolean
This is never eligible if the order does not have a user, and that user does not have any previous completed orders.
Methods included from OrderLevelCondition
Methods inherited from SolidusFriendlyPromotions::Condition
#applicable?, #eligibility_errors, #level, #preload_relations, #to_partial_path, #updateable?
Instance Method Details
#eligible?(order, _options = {}) ⇒ Boolean
This is never eligible if the order does not have a user, and that user does not have any previous completed orders.
Use the first order condition if you want a promotion to be applied to the first order for a user.
17 18 19 20 21 |
# File 'app/models/solidus_friendly_promotions/conditions/nth_order.rb', line 17 def eligible?(order, = {}) return false unless order.user nth_order?(order) end |