Sha256: deb28b491c439845979d7f15742ac6c793582b15593a7ff4428a0cdf285b70e4

Contents?: true

Size: 839 Bytes

Versions: 4

Compression:

Stored size: 839 Bytes

Contents

require ::File.join(Earth.vendor_dir, 'geokit-rails', 'lib', 'geokit-rails')

class ZipCode < ActiveRecord::Base
  self.primary_key = "name"
  
  belongs_to :egrid_subregion,  :foreign_key => 'egrid_subregion_abbreviation'
  belongs_to :climate_division, :foreign_key => 'climate_division_name'
  belongs_to :state,            :foreign_key => 'state_postal_abbreviation'
  
  def country
    Country.united_states
  end
  
  def latitude_longitude
    [latitude, longitude]
  end
  
  acts_as_mappable :default_units => :kilometres,
                   :lat_column_name => :latitude,
                   :lng_column_name => :longitude
  
  col :name
  col :state_postal_abbreviation
  col :description
  col :latitude
  col :longitude
  col :egrid_subregion_abbreviation
  col :climate_division_name
  col :population, :type => :integer
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
earth-0.11.16 lib/earth/locality/zip_code.rb
earth-0.11.15 lib/earth/locality/zip_code.rb
earth-0.11.14 lib/earth/locality/zip_code.rb
earth-0.11.13 lib/earth/locality/zip_code.rb