Sha256: 172af6bf26f9045449d02e3fb482da94f811e2bc5e7acb63c39dc03bff503317
Contents?: true
Size: 508 Bytes
Versions: 26
Compression:
Stored size: 508 Bytes
Contents
module Spree class Country < ActiveRecord::Base has_many :states, -> { order('name ASC') }, dependent: :destroy has_many :addresses, dependent: :nullify validates :name, :iso_name, presence: true def self.states_required_by_country_id states_required = Hash.new(true) all.each { |country| states_required[country.id.to_s]= country.states_required } states_required end def <=>(other) name <=> other.name end def to_s name end end end
Version data entries
26 entries across 26 versions & 1 rubygems