Class: Spree::Country
- Inherits:
-
Base
- Object
- ActiveRecord::Base
- Base
- Spree::Country
show all
- Defined in:
- app/models/spree/country.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
display_includes
#generate_permalink, #save_permalink
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
|