earth 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/Gemfile +1 -0
  2. data/TODO +2 -0
  3. data/bin/earth_tester.rb +62 -9
  4. data/earth.gemspec +7 -4
  5. data/lib/earth.rb +18 -17
  6. data/lib/earth/air.rb +2 -0
  7. data/lib/earth/air/aircraft.rb +76 -19
  8. data/lib/earth/air/aircraft/data_miner.rb +1 -63
  9. data/lib/earth/air/aircraft_class.rb +48 -12
  10. data/lib/earth/air/aircraft_class/data_miner.rb +3 -46
  11. data/lib/earth/air/aircraft_fuel_use_equation.rb +11 -13
  12. data/lib/earth/air/aircraft_instance.rb +9 -0
  13. data/lib/earth/air/aircraft_instance_seat_class.rb +12 -0
  14. data/lib/earth/air/airline.rb +6 -8
  15. data/lib/earth/air/airline/data_miner.rb +3 -3
  16. data/lib/earth/air/airport.rb +8 -10
  17. data/lib/earth/air/airport/data_miner.rb +1 -1
  18. data/lib/earth/air/bts_aircraft.rb +3 -5
  19. data/lib/earth/air/flight_distance_class.rb +4 -6
  20. data/lib/earth/air/flight_seat_class.rb +5 -7
  21. data/lib/earth/air/flight_segment.rb +58 -42
  22. data/lib/earth/air/flight_segment/data_miner.rb +11 -26
  23. data/lib/earth/automobile.rb +1 -0
  24. data/lib/earth/automobile/automobile_fuel.rb +78 -25
  25. data/lib/earth/automobile/automobile_fuel/data_miner.rb +5 -72
  26. data/lib/earth/automobile/automobile_make.rb +14 -6
  27. data/lib/earth/automobile/automobile_make/data_miner.rb +20 -35
  28. data/lib/earth/automobile/automobile_make_fleet_year.rb +39 -10
  29. data/lib/earth/automobile/automobile_make_fleet_year/data_miner.rb +0 -29
  30. data/lib/earth/automobile/automobile_make_model.rb +30 -9
  31. data/lib/earth/automobile/automobile_make_model/data_miner.rb +11 -26
  32. data/lib/earth/automobile/automobile_make_model_year.rb +41 -12
  33. data/lib/earth/automobile/automobile_make_model_year/data_miner.rb +14 -34
  34. data/lib/earth/automobile/automobile_make_model_year_variant.rb +56 -38
  35. data/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb +15 -61
  36. data/lib/earth/automobile/automobile_make_year.rb +15 -8
  37. data/lib/earth/automobile/automobile_make_year/data_miner.rb +17 -51
  38. data/lib/earth/automobile/automobile_size_class.rb +78 -14
  39. data/lib/earth/automobile/automobile_size_class/data_miner.rb +0 -66
  40. data/lib/earth/automobile/automobile_size_class_year.rb +38 -10
  41. data/lib/earth/automobile/automobile_size_class_year/data_miner.rb +0 -30
  42. data/lib/earth/automobile/automobile_type_fuel_age.rb +60 -11
  43. data/lib/earth/automobile/automobile_type_fuel_age/data_miner.rb +10 -65
  44. data/lib/earth/automobile/automobile_type_fuel_control.rb +41 -10
  45. data/lib/earth/automobile/automobile_type_fuel_control/data_miner.rb +0 -33
  46. data/lib/earth/automobile/automobile_type_fuel_year.rb +60 -15
  47. data/lib/earth/automobile/automobile_type_fuel_year/data_miner.rb +1 -52
  48. data/lib/earth/automobile/automobile_type_fuel_year_age.rb +64 -12
  49. data/lib/earth/automobile/automobile_type_fuel_year_age/data_miner.rb +1 -59
  50. data/lib/earth/automobile/automobile_type_fuel_year_control.rb +31 -10
  51. data/lib/earth/automobile/automobile_type_fuel_year_control/data_miner.rb +2 -32
  52. data/lib/earth/automobile/automobile_type_year.rb +51 -10
  53. data/lib/earth/automobile/automobile_type_year/data_miner.rb +1 -43
  54. data/lib/earth/automobile/data_miner.rb +1 -0
  55. data/lib/earth/bus/bus_class.rb +108 -28
  56. data/lib/earth/bus/bus_class/data_miner.rb +0 -88
  57. data/lib/earth/bus/bus_fuel.rb +83 -15
  58. data/lib/earth/bus/bus_fuel/data_miner.rb +0 -76
  59. data/lib/earth/bus/bus_fuel_control.rb +8 -10
  60. data/lib/earth/bus/bus_fuel_year_control.rb +7 -9
  61. data/lib/earth/bus/bus_fuel_year_control/data_miner.rb +1 -5
  62. data/lib/earth/computation/computation_carrier.rb +11 -5
  63. data/lib/earth/computation/computation_carrier/data_miner.rb +0 -7
  64. data/lib/earth/computation/computation_carrier_instance_class.rb +25 -8
  65. data/lib/earth/computation/computation_carrier_instance_class/data_miner.rb +0 -18
  66. data/lib/earth/computation/computation_carrier_region.rb +5 -7
  67. data/lib/earth/diet/diet_class.rb +14 -16
  68. data/lib/earth/diet/food_group.rb +7 -9
  69. data/lib/earth/fuel/fuel.rb +14 -16
  70. data/lib/earth/fuel/fuel/data_miner.rb +7 -3
  71. data/lib/earth/fuel/fuel_price.rb +4 -6
  72. data/lib/earth/fuel/fuel_type.rb +12 -14
  73. data/lib/earth/fuel/fuel_year.rb +57 -16
  74. data/lib/earth/fuel/fuel_year/data_miner.rb +0 -43
  75. data/lib/earth/fuel/greenhouse_gas.rb +46 -9
  76. data/lib/earth/fuel/greenhouse_gas/data_miner.rb +0 -38
  77. data/lib/earth/hospitality/lodging_class.rb +10 -12
  78. data/lib/earth/industry/industry.rb +3 -5
  79. data/lib/earth/industry/industry_product.rb +6 -8
  80. data/lib/earth/industry/industry_product_line.rb +5 -7
  81. data/lib/earth/industry/industry_sector.rb +5 -7
  82. data/lib/earth/industry/merchant.rb +4 -6
  83. data/lib/earth/industry/merchant_category.rb +3 -5
  84. data/lib/earth/industry/merchant_category_industry.rb +5 -7
  85. data/lib/earth/industry/product_line.rb +5 -7
  86. data/lib/earth/industry/product_line_industry_product.rb +5 -7
  87. data/lib/earth/industry/sector.rb +5 -7
  88. data/lib/earth/locality/census_division.rb +21 -23
  89. data/lib/earth/locality/census_region.rb +3 -5
  90. data/lib/earth/locality/climate_division.rb +5 -7
  91. data/lib/earth/locality/country.rb +13 -15
  92. data/lib/earth/locality/egrid_region.rb +14 -5
  93. data/lib/earth/locality/egrid_region/data_miner.rb +0 -10
  94. data/lib/earth/locality/egrid_subregion.rb +71 -18
  95. data/lib/earth/locality/egrid_subregion/data_miner.rb +0 -59
  96. data/lib/earth/locality/petroleum_administration_for_defense_district.rb +6 -8
  97. data/lib/earth/locality/state.rb +6 -8
  98. data/lib/earth/locality/urbanity.rb +2 -4
  99. data/lib/earth/locality/urbanity/data_miner.rb +7 -3
  100. data/lib/earth/locality/zip_code.rb +8 -10
  101. data/lib/earth/pet/breed.rb +5 -7
  102. data/lib/earth/pet/breed_gender.rb +6 -8
  103. data/lib/earth/pet/gender.rb +2 -4
  104. data/lib/earth/pet/species.rb +15 -17
  105. data/lib/earth/rail/rail_class.rb +64 -14
  106. data/lib/earth/rail/rail_class/data_miner.rb +0 -51
  107. data/lib/earth/residence/air_conditioner_use.rb +4 -6
  108. data/lib/earth/residence/air_conditioner_use/data_miner.rb +7 -3
  109. data/lib/earth/residence/clothes_machine_use.rb +4 -6
  110. data/lib/earth/residence/clothes_machine_use/data_miner.rb +11 -9
  111. data/lib/earth/residence/dishwasher_use.rb +4 -6
  112. data/lib/earth/residence/dishwasher_use/data_miner.rb +11 -9
  113. data/lib/earth/residence/residence_appliance.rb +4 -6
  114. data/lib/earth/residence/residence_class.rb +2 -4
  115. data/lib/earth/residence/residence_class/data_miner.rb +7 -3
  116. data/lib/earth/residence/residence_fuel_price.rb +12 -14
  117. data/lib/earth/residence/residence_fuel_price/data_miner.rb +7 -0
  118. data/lib/earth/residence/residence_fuel_type.rb +6 -8
  119. data/lib/earth/residence/residential_energy_consumption_survey_response.rb +91 -93
  120. data/lib/earth/residence/residential_energy_consumption_survey_response/data_miner.rb +9 -8
  121. data/lib/earth/shipping/carrier.rb +57 -10
  122. data/lib/earth/shipping/carrier/data_miner.rb +0 -48
  123. data/lib/earth/shipping/carrier_mode.rb +41 -10
  124. data/lib/earth/shipping/carrier_mode/data_miner.rb +0 -33
  125. data/lib/earth/shipping/shipment_mode.rb +30 -7
  126. data/lib/earth/shipping/shipment_mode/data_miner.rb +0 -23
  127. data/lib/earth/utils.rb +45 -0
  128. data/lib/earth/version.rb +1 -1
  129. data/spec/earth/air/aircraft_spec.rb +1 -1
  130. data/vendor/clean_find_in_batches/init.rb +35 -0
  131. metadata +74 -47
@@ -11,12 +11,10 @@ class FoodGroup < ActiveRecord::Base
11
11
  end
12
12
  end
13
13
 
14
- force_schema do
15
- string 'name'
16
- float 'intensity'
17
- string 'intensity_units'
18
- float 'energy'
19
- string 'energy_units'
20
- string 'suggested_imperial_measurement' # ?
21
- end
22
- end
14
+ col :name
15
+ col :intensity, :type => :float
16
+ col :intensity_units
17
+ col :energy, :type => :float
18
+ col :energy_units
19
+ col :suggested_imperial_measurement # ?
20
+ end
@@ -3,21 +3,19 @@ class Fuel < ActiveRecord::Base
3
3
 
4
4
  has_many :fuel_years, :foreign_key => 'fuel_name'
5
5
 
6
- force_schema do
7
- string 'name'
8
- float 'density'
9
- string 'density_units'
10
- float 'energy_content'
11
- string 'energy_content_units'
12
- float 'carbon_content'
13
- string 'carbon_content_units'
14
- float 'oxidation_factor'
15
- float 'biogenic_fraction'
16
- float 'co2_emission_factor'
17
- string 'co2_emission_factor_units'
18
- float 'co2_biogenic_emission_factor'
19
- string 'co2_biogenic_emission_factor_units'
20
- end
6
+ col :name
7
+ col :density, :type => :float
8
+ col :density_units
9
+ col :energy_content, :type => :float
10
+ col :energy_content_units
11
+ col :carbon_content, :type => :float
12
+ col :carbon_content_units
13
+ col :oxidation_factor, :type => :float
14
+ col :biogenic_fraction, :type => :float
15
+ col :co2_emission_factor, :type => :float
16
+ col :co2_emission_factor_units
17
+ col :co2_biogenic_emission_factor, :type => :float
18
+ col :co2_biogenic_emission_factor_units
21
19
 
22
20
  def latest_year
23
21
  fuel_years.find_by_year(fuel_years.maximum('year'))
@@ -102,4 +100,4 @@ class Fuel < ActiveRecord::Base
102
100
  latest_year.co2_biogenic_emission_factor_units
103
101
  end
104
102
  end
105
- end
103
+ end
@@ -5,9 +5,13 @@ Fuel.class_eval do
5
5
  end
6
6
 
7
7
  process "Derive fuel names from FuelYear" do
8
- INSERT_IGNORE %{INTO fuels(name)
9
- SELECT DISTINCT fuel_years.fuel_name FROM fuel_years
10
- }
8
+ ::Earth::Utils.insert_ignore(
9
+ :src => FuelYear,
10
+ :dest => Fuel,
11
+ :cols => {
12
+ :fuel_name => :name
13
+ }
14
+ )
11
15
  end
12
16
 
13
17
  import "fuels with non-variable characteristics",
@@ -3,9 +3,7 @@ class FuelPrice < ActiveRecord::Base
3
3
 
4
4
  belongs_to :fuel_type, :foreign_key => 'name' # weird
5
5
 
6
- force_schema do
7
- string 'name'
8
- float 'price'
9
- string 'price_units'
10
- end
11
- end
6
+ col :name
7
+ col :price, :type => :float
8
+ col :price_units
9
+ end
@@ -12,17 +12,15 @@ class FuelType < ActiveRecord::Base
12
12
  prices.average :price
13
13
  end
14
14
 
15
- force_schema do
16
- string 'name'
17
- float 'emission_factor'
18
- string 'emission_factor_units'
19
- float 'density'
20
- string 'density_units'
21
- float 'average_purchase_volume'
22
- string 'average_purchase_volume_units'
23
- # float 'energy_content'
24
- # string 'energy_content_units'
25
- # float 'carbon_content'
26
- # string 'carbon_content_units'
27
- end
28
- end
15
+ col :name
16
+ col :emission_factor, :type => :float
17
+ col :emission_factor_units
18
+ col :density, :type => :float
19
+ col :density_units
20
+ col :average_purchase_volume, :type => :float
21
+ col :average_purchase_volume_units
22
+ # col :energy_content, :type => :float
23
+ # col :energy_content_units
24
+ # col :carbon_content, :type => :float
25
+ # col :carbon_content_units
26
+ end
@@ -1,19 +1,60 @@
1
1
  class FuelYear < ActiveRecord::Base
2
2
  set_primary_key :name
3
3
 
4
- force_schema do
5
- string 'name'
6
- string 'fuel_name'
7
- integer 'year'
8
- float 'energy_content'
9
- string 'energy_content_units'
10
- float 'carbon_content'
11
- string 'carbon_content_units'
12
- float 'oxidation_factor'
13
- float 'biogenic_fraction'
14
- float 'co2_emission_factor'
15
- string 'co2_emission_factor_units'
16
- float 'co2_biogenic_emission_factor'
17
- string 'co2_biogenic_emission_factor_units'
18
- end
19
- end
4
+ col :name
5
+ col :fuel_name
6
+ col :year, :type => :integer
7
+ col :energy_content, :type => :float
8
+ col :energy_content_units
9
+ col :carbon_content, :type => :float
10
+ col :carbon_content_units
11
+ col :oxidation_factor, :type => :float
12
+ col :biogenic_fraction, :type => :float
13
+ col :co2_emission_factor, :type => :float
14
+ col :co2_emission_factor_units
15
+ col :co2_biogenic_emission_factor, :type => :float
16
+ col :co2_biogenic_emission_factor_units
17
+
18
+ # FIXME TODO verify fuel name is in Fuel
19
+ # verify "Fuel name should never be missing" do
20
+ # FuelYear.all.each do |record|
21
+ # fuel_name = record.send(:fuel_name)
22
+ # if fuel_name.nil?
23
+ # raise "Missing fuel name for FuelYear '#{record.name}'"
24
+ # end
25
+ # end
26
+ # end
27
+ #
28
+ # verify "Year should be from 1990 to 2008" do
29
+ # FuelYear.all.each do |record|
30
+ # year = record.send(:year)
31
+ # unless year > 1989 and year < 2009
32
+ # raise "Invalid year for FuelYear '#{record.name}': #{year} (should be from 1990 to 2008)"
33
+ # end
34
+ # end
35
+ # end
36
+ #
37
+ # verify "Carbon content and energy content should be greater than zero" do
38
+ # FuelYear.all.each do |record|
39
+ # %w{ carbon_content energy_content }.each do |attribute|
40
+ # value = record.send(:"#{attribute}")
41
+ # unless value > 0
42
+ # raise "Invalid #{attribute} for FuelYear '#{record.name}': #{value} (should be > 0)"
43
+ # end
44
+ # end
45
+ # end
46
+ # end
47
+ #
48
+ # verify "Emission factors should be zero or more" do
49
+ # FuelYear.all.each do |record|
50
+ # %w{ co2_emission_factor co2_biogenic_emission_factor }.each do |attribute|
51
+ # value = record.send(:"#{attribute}")
52
+ # unless value >= 0
53
+ # raise "Invalid #{attribute} for FuelYear '#{record.name}': #{value} (should be >= 0)"
54
+ # end
55
+ # end
56
+ # end
57
+ # end
58
+ #
59
+ # FIXME TODO verify units
60
+ end
@@ -82,48 +82,5 @@ FuelYear.class_eval do
82
82
  WHERE energy_content_units = 'megajoules_per_cubic_metre'
83
83
  }
84
84
  end
85
-
86
- # FIXME TODO verify fuel name is in Fuel
87
- verify "Fuel name should never be missing" do
88
- FuelYear.all.each do |record|
89
- fuel_name = record.send(:fuel_name)
90
- if fuel_name.nil?
91
- raise "Missing fuel name for FuelYear '#{record.name}'"
92
- end
93
- end
94
- end
95
-
96
- verify "Year should be from 1990 to 2008" do
97
- FuelYear.all.each do |record|
98
- year = record.send(:year)
99
- unless year > 1989 and year < 2009
100
- raise "Invalid year for FuelYear '#{record.name}': #{year} (should be from 1990 to 2008)"
101
- end
102
- end
103
- end
104
-
105
- verify "Carbon content and energy content should be greater than zero" do
106
- FuelYear.all.each do |record|
107
- %w{ carbon_content energy_content }.each do |attribute|
108
- value = record.send(:"#{attribute}")
109
- unless value > 0
110
- raise "Invalid #{attribute} for FuelYear '#{record.name}': #{value} (should be > 0)"
111
- end
112
- end
113
- end
114
- end
115
-
116
- verify "Emission factors should be zero or more" do
117
- FuelYear.all.each do |record|
118
- %w{ co2_emission_factor co2_biogenic_emission_factor }.each do |attribute|
119
- value = record.send(:"#{attribute}")
120
- unless value >= 0
121
- raise "Invalid #{attribute} for FuelYear '#{record.name}': #{value} (should be >= 0)"
122
- end
123
- end
124
- end
125
- end
126
-
127
- # FIXME TODO verify units
128
85
  end
129
86
  end
@@ -7,12 +7,49 @@ class GreenhouseGas < ActiveRecord::Base
7
7
  end
8
8
  end
9
9
 
10
- force_schema do
11
- string 'name'
12
- string 'abbreviation'
13
- string 'ipcc_report'
14
- integer 'time_horizon'
15
- string 'time_horizon_units'
16
- integer 'global_warming_potential'
17
- end
18
- end
10
+ col :name
11
+ col :abbreviation
12
+ col :ipcc_report
13
+ col :time_horizon, :type => :integer
14
+ col :time_horizon_units
15
+ col :global_warming_potential, :type => :integer
16
+
17
+ # verify "Abbreviation and IPCC report should never be missing" do
18
+ # GreenhouseGas.all.each do |record|
19
+ # %w{ abbreviation ipcc_report }.each do |attribute|
20
+ # value = record.send(:"#{attribute}")
21
+ # unless value.present?
22
+ # raise "Missing #{attribute} for GreenhouseGas '#{record.name}'"
23
+ # end
24
+ # end
25
+ # end
26
+ # end
27
+ #
28
+ # verify "Time horizon should be 100" do
29
+ # GreenhouseGas.all.each do |record|
30
+ # value = record.send(:time_horizon)
31
+ # unless value == 100
32
+ # raise "Invalid time horizon for GreenhouseGas '#{record.name}': #{value} (should be 100)"
33
+ # end
34
+ # end
35
+ # end
36
+ #
37
+ # verify "Time horizon units should be years" do
38
+ # GreenhouseGas.all.each do |record|
39
+ # units = record.send(:time_horizon_units)
40
+ # unless units == "years"
41
+ # raise "Invalid time horizon units for GreenhouseGas '#{record.name}': #{units} (should be years)"
42
+ # end
43
+ # end
44
+ # end
45
+ #
46
+ # verify "Global warming potential should be one or more" do
47
+ # GreenhouseGas.all.each do |record|
48
+ # value = record.send(:global_warming_potential)
49
+ # unless value >= 1
50
+ # raise "Invalid global warming potential for GreenhouseGas '#{record.name}': #{value} (should >= 1)"
51
+ # end
52
+ # end
53
+ # end
54
+
55
+ end
@@ -8,43 +8,5 @@ GreenhouseGas.class_eval do
8
8
  store 'time_horizon', :units_field_name => 'time_horizon_units'
9
9
  store 'global_warming_potential'
10
10
  end
11
-
12
- verify "Abbreviation and IPCC report should never be missing" do
13
- GreenhouseGas.all.each do |record|
14
- %w{ abbreviation ipcc_report }.each do |attribute|
15
- value = record.send(:"#{attribute}")
16
- unless value.present?
17
- raise "Missing #{attribute} for GreenhouseGas '#{record.name}'"
18
- end
19
- end
20
- end
21
- end
22
-
23
- verify "Time horizon should be 100" do
24
- GreenhouseGas.all.each do |record|
25
- value = record.send(:time_horizon)
26
- unless value == 100
27
- raise "Invalid time horizon for GreenhouseGas '#{record.name}': #{value} (should be 100)"
28
- end
29
- end
30
- end
31
-
32
- verify "Time horizon units should be years" do
33
- GreenhouseGas.all.each do |record|
34
- units = record.send(:time_horizon_units)
35
- unless units == "years"
36
- raise "Invalid time horizon units for GreenhouseGas '#{record.name}': #{units} (should be years)"
37
- end
38
- end
39
- end
40
-
41
- verify "Global warming potential should be one or more" do
42
- GreenhouseGas.all.each do |record|
43
- value = record.send(:global_warming_potential)
44
- unless value >= 1
45
- raise "Invalid global warming potential for GreenhouseGas '#{record.name}': #{value} (should >= 1)"
46
- end
47
- end
48
- end
49
11
  end
50
12
  end
@@ -1,15 +1,13 @@
1
1
  class LodgingClass < ActiveRecord::Base
2
2
  set_primary_key :name
3
3
 
4
- force_schema do
5
- string 'name'
6
- float 'electricity_intensity'
7
- string 'electricity_intensity_units'
8
- float 'natural_gas_intensity'
9
- string 'natural_gas_intensity_units'
10
- float 'fuel_oil_intensity'
11
- string 'fuel_oil_intensity_units'
12
- float 'district_heat_intensity'
13
- string 'district_heat_intensity_units'
14
- end
15
- end
4
+ col :name
5
+ col :electricity_intensity, :type => :float
6
+ col :electricity_intensity_units
7
+ col :natural_gas_intensity, :type => :float
8
+ col :natural_gas_intensity_units
9
+ col :fuel_oil_intensity, :type => :float
10
+ col :fuel_oil_intensity_units
11
+ col :district_heat_intensity, :type => :float
12
+ col :district_heat_intensity_units
13
+ end
@@ -9,13 +9,11 @@ class Industry < ActiveRecord::Base
9
9
  has_many :industry_sectors, :foreign_key => 'naics_code'
10
10
  has_many :sectors, :through => :industry_sectors
11
11
 
12
- force_schema do
13
- string 'naics_code'
14
- string 'description'
15
- end
12
+ col :naics_code
13
+ col :description
16
14
 
17
15
  def trade_industry?
18
16
  prefix = naics_code.to_s[0,2]
19
17
  %w{42 44 45}.include?(prefix)
20
18
  end
21
- end
19
+ end
@@ -5,11 +5,9 @@ class IndustryProduct < ActiveRecord::Base
5
5
 
6
6
  belongs_to :industry, :foreign_key => 'naics_code'
7
7
 
8
- force_schema do
9
- string 'naics_product_code'
10
- string 'description'
11
- float 'value'
12
- string 'value_units'
13
- string 'naics_code'
14
- end
15
- end
8
+ col :naics_product_code
9
+ col :description
10
+ col :value, :type => :float
11
+ col :value_units
12
+ col :naics_code
13
+ end
@@ -4,10 +4,8 @@ class IndustryProductLine < ActiveRecord::Base
4
4
  belongs_to :industry, :foreign_key => 'naics_code'
5
5
  belongs_to :product_line, :foreign_key => 'ps_code'
6
6
 
7
- force_schema do
8
- string 'row_hash'
9
- string 'naics_code'
10
- float 'ratio'
11
- string 'ps_code'
12
- end
13
- end
7
+ col :row_hash
8
+ col :naics_code
9
+ col :ratio, :type => :float
10
+ col :ps_code
11
+ end
@@ -4,10 +4,8 @@ class IndustrySector < ActiveRecord::Base
4
4
  belongs_to :industry, :foreign_key => 'naics_code'
5
5
  belongs_to :sector, :foreign_key => 'io_code'
6
6
 
7
- force_schema do
8
- string 'row_hash'
9
- string 'naics_code'
10
- float 'ratio'
11
- string 'io_code'
12
- end
13
- end
7
+ col :row_hash
8
+ col :naics_code
9
+ col :ratio, :type => :float
10
+ col :io_code
11
+ end