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