Class: SolidusPromotions::Conditions::UserRole
- Inherits:
-
SolidusPromotions::Condition
- Object
- Spree::Base
- SolidusPromotions::Condition
- SolidusPromotions::Conditions::UserRole
- Defined in:
- app/models/solidus_promotions/conditions/user_role.rb
Constant Summary collapse
- MATCH_POLICIES =
%w[any all].freeze
Instance Method Summary collapse
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
11 12 13 14 15 16 17 18 19 |
# File 'app/models/solidus_promotions/conditions/user_role.rb', line 11 def order_eligible?(order, = {}) return false unless order.user if all_match_policy? match_all_roles?(order) else match_any_roles?(order) end end |