Sha256: bc8ee46abc61b00a29ac2b6a2dc5f955d5d59a650eec6304c450acc9bc1dc07a

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

# Currently just US states + DC
class State < ActiveRecordShared

	acts_as_list
	default_scope :order => :position


	validates_presence_of   :code
	validates_presence_of   :name
	validates_presence_of   :fips_state_code
	validates_presence_of   :fips_country_code
	validates_uniqueness_of :code
	validates_uniqueness_of :name
	validates_uniqueness_of :fips_state_code
	validates_length_of     :code, :maximum => 250, :allow_blank => true
	validates_length_of     :name, :maximum => 250, :allow_blank => true
	validates_length_of     :fips_state_code, :maximum => 250, :allow_blank => true
	validates_length_of     :fips_country_code, :maximum => 250, :allow_blank => true

	# Returns an array of state abbreviations.
	def self.abbreviations
		@@abbreviations ||= all.collect(&:code)
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ccls-ccls_engine-3.11.0 app/models/state.rb