Class: SolidusPromotions::Conditions::NthOrder
- Inherits:
-
SolidusPromotions::Condition
- Object
- Spree::Base
- SolidusPromotions::Condition
- SolidusPromotions::Conditions::NthOrder
- Includes:
- OrderLevelCondition
- Defined in:
- app/models/solidus_promotions/conditions/nth_order.rb
Instance Method Summary collapse
-
#order_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 SolidusPromotions::Condition
#applicable?, applicable_to, #eligibility_errors, #eligible?, eligible_method_for, inherited, #level, #preload_relations, #to_partial_path, #updateable?
Instance Method Details
#order_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.
18 19 20 21 22 |
# File 'app/models/solidus_promotions/conditions/nth_order.rb', line 18 def order_eligible?(order, = {}) return false unless order.user nth_order?(order) end |