Sha256: 3af3c88a848666c63ea9ff63c87e8a13ec241cec08a1776cfaaddf399b45eb8c

Contents?: true

Size: 426 Bytes

Versions: 6

Compression:

Stored size: 426 Bytes

Contents

module Spree
  class Country < ActiveRecord::Base
    has_many :states, :order => "name ASC", :class_name => "Spree::State"

    has_one :zone_member, :as => :zoneable, :class_name => "Spree::ZoneMember"
    has_one :zone, :through => :zone_member, :class_name => "Spree::Zone"

    validates :name, :iso_name, :presence => true

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

    def to_s
      name
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_core-1.1.6 app/models/spree/country.rb
spree_core-1.1.5 app/models/spree/country.rb
spree_core-1.1.4 app/models/spree/country.rb
spree_core-1.1.3 app/models/spree/country.rb
spree_core-1.1.2 app/models/spree/country.rb
spree_core-1.1.2.rc1 app/models/spree/country.rb