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
page
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Class Method Details
.default ⇒ Object
16
17
18
19
|
# File 'app/models/spree/country.rb', line 16
def self.default
country_id = Spree::Config[:default_country_id]
country_id.present? ? find(country_id) : find_by!(iso: 'US')
end
|
Instance Method Details
#<=>(other) ⇒ Object
21
22
23
|
# File 'app/models/spree/country.rb', line 21
def <=>(other)
name <=> other.name
end
|
#to_s ⇒ Object
25
26
27
|
# File 'app/models/spree/country.rb', line 25
def to_s
name
end
|