Class: SolidusFriendlyPromotions::Condition
- Inherits:
-
Spree::Base
- Object
- Spree::Base
- SolidusFriendlyPromotions::Condition
show all
- Includes:
- Spree::Preferences::Persistable
- Defined in:
- app/models/solidus_friendly_promotions/condition.rb
Direct Known Subclasses
SolidusFriendlyPromotions::Conditions::FirstOrder, SolidusFriendlyPromotions::Conditions::FirstRepeatPurchaseSince, SolidusFriendlyPromotions::Conditions::ItemTotal, SolidusFriendlyPromotions::Conditions::LineItemOptionValue, SolidusFriendlyPromotions::Conditions::LineItemProduct, SolidusFriendlyPromotions::Conditions::LineItemTaxon, SolidusFriendlyPromotions::Conditions::MinimumQuantity, SolidusFriendlyPromotions::Conditions::NthOrder, SolidusFriendlyPromotions::Conditions::OneUsePerUser, SolidusFriendlyPromotions::Conditions::OptionValue, SolidusFriendlyPromotions::Conditions::Product, SolidusFriendlyPromotions::Conditions::ShippingMethod, SolidusFriendlyPromotions::Conditions::Store, SolidusFriendlyPromotions::Conditions::Taxon, SolidusFriendlyPromotions::Conditions::User, SolidusFriendlyPromotions::Conditions::UserLoggedIn, SolidusFriendlyPromotions::Conditions::UserRole
Instance Method Summary
collapse
Instance Method Details
#applicable?(_promotable) ⇒ Boolean
21
22
23
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 21
def applicable?(_promotable)
raise NotImplementedError, "applicable? should be implemented in a sub-class of SolidusFriendlyPromotions::Rule"
end
|
#eligibility_errors ⇒ Object
33
34
35
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 33
def eligibility_errors
@eligibility_errors ||= ActiveModel::Errors.new(self)
end
|
#eligible?(_promotable, _options = {}) ⇒ Boolean
25
26
27
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 25
def eligible?(_promotable, _options = {})
raise NotImplementedError, "eligible? should be implemented in a sub-class of SolidusFriendlyPromotions::Rule"
end
|
#level ⇒ Object
29
30
31
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 29
def level
raise NotImplementedError, "level should be implemented in a sub-class of SolidusFriendlyPromotions::Rule"
end
|
#preload_relations ⇒ Object
17
18
19
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 17
def preload_relations
[]
end
|
#to_partial_path ⇒ Object
37
38
39
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 37
def to_partial_path
"solidus_friendly_promotions/admin/condition_fields/#{model_name.element}"
end
|
#updateable? ⇒ Boolean
41
42
43
|
# File 'app/models/solidus_friendly_promotions/condition.rb', line 41
def updateable?
preferences.any?
end
|