Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix Industry import

  • Loading branch information...
commit f3ff3dca4360f24fb160dcea78dedb44ec2f42ec 1 parent 8ee8387
@ihough ihough authored
View
2  lib/earth/industry/industry.rb
@@ -1,5 +1,3 @@
-require 'earth/locality'
-
# TODO replace this with NAICS 2002?
class Industry < ActiveRecord::Base
self.primary_key = "naics_code"
View
7 lib/earth/industry/industry/data_miner.rb
@@ -1,8 +1,11 @@
-require 'earth/locality/data_miner'
Industry.class_eval do
data_miner do
+ process "Start from scratch" do
+ delete_all
+ end
+
import "the U.S. Census 2002 NAICS code list",
- :url => 'http://www.census.gov/epcd/naics02/naicod02.txt',
+ :url => 'http://www.census.gov/eos/www/naics/reference_files_tools/2002/naics_2_6_02.txt',
:skip => 4,
:headers => false,
:delimiter => ' ' do
View
4 spec/earth/industry/industry_spec.rb
@@ -13,9 +13,7 @@
end
describe "verify imported data", :sanity => true do
- it "should have all the data" do
- Industry.count.should == 2341
- end
+ it { Industry.count.should == 2341 }
end
describe "methods" do
Please sign in to comment.
Something went wrong with that request. Please try again.