Class: Spree::Country
- Inherits:
-
Object
- Object
- Spree::Country
- Defined in:
- app/models/spree/country.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.by_iso(iso) ⇒ Object
17 18 19 |
# File 'app/models/spree/country.rb', line 17 def self.by_iso(iso) where(['LOWER(iso) = ?', iso.downcase]).or(where(['LOWER(iso3) = ?', iso.downcase])).take end |
Instance Method Details
#<=>(other) ⇒ Object
26 27 28 |
# File 'app/models/spree/country.rb', line 26 def <=>(other) name <=> other.name end |
#default?(store = nil) ⇒ Boolean
21 22 23 24 |
# File 'app/models/spree/country.rb', line 21 def default?(store = nil) store ||= Spree::Store.default self == store.default_country end |
#to_s ⇒ Object
30 31 32 |
# File 'app/models/spree/country.rb', line 30 def to_s name end |