Class: Spree::Country

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/country.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

page, spree_base_scopes

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.defaultObject



19
20
21
22
# File 'app/models/spree/country.rb', line 19

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



24
25
26
# File 'app/models/spree/country.rb', line 24

def <=>(other)
  name <=> other.name
end

#to_sObject



28
29
30
# File 'app/models/spree/country.rb', line 28

def to_s
  name
end