Class: Spree::Promotion::Rules::Country
Instance Method Summary
collapse
#actionable?, #eligibility_errors, for, #human_description, #human_name, #key
Instance Method Details
#applicable?(promotable) ⇒ Boolean
9
10
11
|
# File 'app/models/spree/promotion/rules/country.rb', line 9
def applicable?(promotable)
promotable.is_a?(Spree::Order)
end
|
#eligible?(order, options = {}) ⇒ Boolean
13
14
15
16
17
18
19
|
# File 'app/models/spree/promotion/rules/country.rb', line 13
def eligible?(order, options = {})
if preferred_country_iso.present?
validate_eligibility_by_country_iso(order)
else
validate_eligibility_by_country_id(order, options)
end
end
|