lib/earth/locality/zip_code.rb in earth-1.1.2 vs lib/earth/locality/zip_code.rb in earth-1.2.1

- old
+ new

@@ -6,22 +6,18 @@ require 'earth/locality/egrid_subregion' require 'earth/locality/state' require 'earth/electricity/electric_market' require 'earth/electricity/electric_utility' -require 'geocoder' - class ZipCode < ActiveRecord::Base data_miner do process "Ensure Country is imported because it's like a belongs_to association" do Country.run_data_miner! end end extend Earth::Model - extend Geocoder::Model::ActiveRecord - Geocoder::Configuration.units = :km TABLE_STRUCTURE = <<-EOS CREATE TABLE zip_codes ( @@ -44,11 +40,9 @@ belongs_to :egrid_subregion, :foreign_key => 'egrid_subregion_abbreviation' has_many :electric_markets, :foreign_key => 'zip_code_name' has_many :electric_utilities, :through => :electric_markets scope :known_subregion, where('egrid_subregion_abbreviation IS NOT NULL') - - reverse_geocoded_by :latitude, :longitude def country Country.united_states end