Class: Spree::Country
- Inherits:
-
Base
- Object
- Base
- Spree::Country
- Defined in:
- app/models/spree/country.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.available(restrict_to_zone: Spree::Config[:checkout_zone]) ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/models/spree/country.rb', line 28 def self.available(restrict_to_zone: Spree::Config[:checkout_zone]) checkout_zone = Zone.find_by(name: restrict_to_zone) return checkout_zone.country_list if checkout_zone.try(:kind) == "country" all end |
.default ⇒ Object
24 25 26 |
# File 'app/models/spree/country.rb', line 24 def self.default find_by!(iso: Spree::Config.default_country_iso) end |
Instance Method Details
#<=>(other) ⇒ Object
36 37 38 |
# File 'app/models/spree/country.rb', line 36 def <=>(other) name <=> other.name end |
#to_s ⇒ Object
40 41 42 |
# File 'app/models/spree/country.rb', line 40 def to_s name end |