require 'earth/model' class Recs2009Response < ActiveRecord::Base extend Earth::Model TABLE_STRUCTURE = <<-EOS CREATE TABLE recs_2009_responses ( id INTEGER NOT NULL PRIMARY KEY, weighting FLOAT, census_region_number INTEGER, census_division_number INTEGER, recs_grouping_id INTEGER, urban_rural CHARACTER VARYING(10), metro_micro CHARACTER VARYING(10), climate_region_id INTEGER, climate_zone_id INTEGER, hdd_2009 FLOAT, hdd_2009_units CHARACTER VARYING(25), hdd_avg FLOAT, hdd_avg_units CHARACTER VARYING(25), cdd_2009 FLOAT, cdd_2009_units CHARACTER VARYING(25), cdd_avg FLOAT, cdd_avg_units CHARACTER VARYING(25), building_type CHARACTER VARYING(25), converted_house BOOLEAN, condo_coop CHARACTER VARYING(10), apartments INTEGER, year_built INTEGER, year_occupied INTEGER, building_floors INTEGER, levels INTEGER, area FLOAT, area_units CHARACTER VARYING(25), rooms INTEGER, bedrooms INTEGER, bathrooms INTEGER, half_baths INTEGER, other_rooms INTEGER, attic_rooms INTEGER, basement_rooms INTEGER, garage_type CHARACTER VARYING(10), garage_size CHARACTER VARYING(10), pool BOOLEAN, shaded BOOLEAN, slab BOOLEAN, crawlspace BOOLEAN, basement_type CHARACTER VARYING(10), attic_type CHARACTER VARYING(10), wall_material CHARACTER VARYING(35), roof_material CHARACTER VARYING(25), windows INTEGER, window_panes INTEGER, sliding_doors INTEGER, insulation CHARACTER VARYING(10), drafty CHARACTER VARYING(20), high_ceiling BOOLEAN, heating BOOLEAN, heater CHARACTER VARYING(30), heater_age INTEGER, heater_fuel CHARACTER VARYING(15), heater_shared BOOLEAN, heater_thermostats INTEGER, heater_portion FLOAT, heater_2 CHARACTER VARYING(30), heater_2_fuel CHARACTER VARYING(15), heater_3 CHARACTER VARYING(30), heater_3_fuel CHARACTER VARYING(15), heater_4 CHARACTER VARYING(30), heater_4_fuel CHARACTER VARYING(15), heater_5 CHARACTER VARYING(30), heater_5_fuel CHARACTER VARYING(15), heater_6 CHARACTER VARYING(30), heater_6_fuel CHARACTER VARYING(15), cooling BOOLEAN, cooler_central_age INTEGER, cooler_central_shared BOOLEAN, cooler_ac_units INTEGER, cooler_ac_age INTEGER, cooler_ac_energy_star BOOLEAN, fans INTEGER, water_heaters_storage INTEGER, water_heaters_tankless INTEGER, water_heater CHARACTER VARYING(15), water_heater_fuel CHARACTER VARYING(15), water_heater_age INTEGER, water_heater_size CHARACTER VARYING(30), water_heater_shared BOOLEAN, water_heater_2 CHARACTER VARYING(15), water_heater_2_fuel CHARACTER VARYING(15), water_heater_2_age INTEGER, water_heater_2_size CHARACTER VARYING(30), pool_fuel CHARACTER VARYING(15), hot_tub_fuel CHARACTER VARYING(15), lights_high_use INTEGER, lights_high_use_efficient INTEGER, lights_med_use INTEGER, lights_med_use_efficient INTEGER, lights_low_use INTEGER, lights_low_use_efficient INTEGER, lights_outdoor INTEGER, lights_outdoor_efficient INTEGER, cooking_fuel CHARACTER VARYING(15), stoves INTEGER, stove_fuel CHARACTER VARYING(15), cooktops INTEGER, cooktop_fuel CHARACTER VARYING(15), ovens INTEGER, oven_fuel CHARACTER VARYING(15), oven_type CHARACTER VARYING(25), outdoor_grill_fuel CHARACTER VARYING(15), indoor_grill_fuel CHARACTER VARYING(15), toaster BOOLEAN, coffee BOOLEAN, fridges INTEGER, fridge_type CHARACTER VARYING(35), fridge_size CHARACTER VARYING(35), fridge_defrost CHARACTER VARYING(10), fridge_door_ice BOOLEAN, fridge_age INTEGER, fridge_energy_star BOOLEAN, fridge_2_type CHARACTER VARYING(35), fridge_2_size CHARACTER VARYING(35), fridge_2_defrost CHARACTER VARYING(10), fridge_2_age INTEGER, fridge_2_energy_star BOOLEAN, fridge_3_type CHARACTER VARYING(35), fridge_3_size CHARACTER VARYING(35), fridge_3_defrost CHARACTER VARYING(10), fridge_3_age INTEGER, fridge_3_energy_star BOOLEAN, freezers INTEGER, freezer_type CHARACTER VARYING(10), freezer_size CHARACTER VARYING(35), freezer_defrost CHARACTER VARYING(10), freezer_age INTEGER, freezer_2_type CHARACTER VARYING(10), freezer_2_size CHARACTER VARYING(35), freezer_2_defrost CHARACTER VARYING(10), freezer_2_age INTEGER, dishwasher_age INTEGER, dishwasher_energy_star BOOLEAN, washer_type CHARACTER VARYING(15), washer_age INTEGER, washer_energy_star BOOLEAN, dryer_fuel CHARACTER VARYING(15), dryer_age INTEGER, tvs INTEGER, tv_size CHARACTER VARYING(20), tv_type CHARACTER VARYING(10), tv_theater BOOLEAN, tv_2_size CHARACTER VARYING(20), tv_2_type CHARACTER VARYING(10), tv_2_theater BOOLEAN, tv_3_size CHARACTER VARYING(20), tv_3_type CHARACTER VARYING(10), tv_3_theater BOOLEAN, computers INTEGER, computer_type CHARACTER VARYING(10), computer_monitor CHARACTER VARYING(10), computer_2_type CHARACTER VARYING(10), computer_2_monitor CHARACTER VARYING(10), computer_3_type CHARACTER VARYING(10), computer_3_monitor CHARACTER VARYING(10), internet BOOLEAN, printers INTEGER, fax BOOLEAN, copier BOOLEAN, well_pump BOOLEAN, engine_block_heater BOOLEAN, aquarium BOOLEAN, stereo BOOLEAN, cordless_phone BOOLEAN, answering_machine BOOLEAN, tools INTEGER, electronics INTEGER, home_business BOOLEAN, home_during_week BOOLEAN, telecommuting INTEGER, telecommuting_units CHARACTER VARYING(15), unusual_activities BOOLEAN, heat_area FLOAT, heat_area_units CHARACTER VARYING(15), heat_rooms INTEGER, heat_attic_portion FLOAT, heat_basement_portion FLOAT, heat_garage BOOLEAN, heat_temp_day FLOAT, heat_temp_day_units CHARACTER VARYING(20), heat_temp_night FLOAT, heat_temp_night_units CHARACTER VARYING(20), heat_temp_away FLOAT, heat_temp_away_units CHARACTER VARYING(20), heat_auto_adjust_day BOOLEAN, heat_auto_adjust_night BOOLEAN, cool_area FLOAT, cool_area_units CHARACTER VARYING(15), cool_rooms INTEGER, cool_attic_portion FLOAT, cool_basement_portion FLOAT, cool_garage BOOLEAN, cool_temp_day FLOAT, cool_temp_day_units CHARACTER VARYING(20), cool_temp_night FLOAT, cool_temp_night_units CHARACTER VARYING(20), cool_temp_away FLOAT, cool_temp_away_units CHARACTER VARYING(20), cool_auto_adjust_day BOOLEAN, cool_auto_adjust_night BOOLEAN, cooler_central_use CHARACTER VARYING(35), cooler_ac_use CHARACTER VARYING(35), fan_use CHARACTER VARYING(35), humidifier_use INTEGER, humidifier_use_units CHARACTER VARYING(10), dehumidifier_use INTEGER, dehumidifier_use_units CHARACTER VARYING(10), oven_use INTEGER, oven_use_units CHARACTER VARYING(15), microwave_use CHARACTER VARYING(30), microwave_defrost BOOLEAN, cooking_frequency INTEGER, cooking_frequency_units CHARACTER VARYING(15), fridge_2_use INTEGER, fridge_2_use_units CHARACTER VARYING(10), fridge_3_use INTEGER, fridge_3_use_units CHARACTER VARYING(10), dishwasher_use INTEGER, dishwasher_use_units CHARACTER VARYING(15), washer_use INTEGER, washer_use_units CHARACTER VARYING(15), washer_temp_wash CHARACTER VARYING(10), washer_temp_rinse CHARACTER VARYING(10), dryer_use CHARACTER VARYING(25), tv_weekday_use INTEGER, tv_weekday_use_units CHARACTER VARYING(15), tv_weekend_use INTEGER, tv_weekend_use_units CHARACTER VARYING(15), tv_2_weekday_use INTEGER, tv_2_weekday_use_units CHARACTER VARYING(15), tv_2_weekend_use INTEGER, tv_2_weekend_use_units CHARACTER VARYING(15), tv_3_weekday_use INTEGER, tv_3_weekday_use_units CHARACTER VARYING(15), tv_3_weekend_use INTEGER, tv_3_weekend_use_units CHARACTER VARYING(15), computer_use INTEGER, computer_use_units CHARACTER VARYING(15), computer_idle CHARACTER VARYING(15), computer_2_use INTEGER, computer_2_use_units CHARACTER VARYING(15), computer_2_idle CHARACTER VARYING(15), computer_3_use INTEGER, computer_3_use_units CHARACTER VARYING(15), computer_3_idle CHARACTER VARYING(15), tool_charging CHARACTER VARYING(20), tool_vampires CHARACTER VARYING(25), electronic_charging CHARACTER VARYING(20), electronic_vampires CHARACTER VARYING(25), energy_audit BOOLEAN, energy_audit_year INTEGER, energy_audit_incent CHARACTER VARYING(35), energy_audit_incent_year INTEGER, insulation_added BOOLEAN, insulation_added_year INTEGER, insulation_incent CHARACTER VARYING(35), insulation_incent_year INTEGER, windows_replaced CHARACTER VARYING(10), windows_incent CHARACTER VARYING(35), windows_incent_year INTEGER, caulking_added BOOLEAN, caulking_added_year INTEGER, caulking_incent CHARACTER VARYING(35), caulking_incent_year INTEGER, heater_maintained BOOLEAN, heater_replaced BOOLEAN, heater_incent CHARACTER VARYING(35), heater_incent_year INTEGER, cooler_central_maintained BOOLEAN, cooler_central_replaced BOOLEAN, cooler_central_incent CHARACTER VARYING(35), cooler_central_incent_year INTEGER, cooler_ac_replaced BOOLEAN, cooler_ac_incent CHARACTER VARYING(35), cooler_ac_incent_year INTEGER, water_heater_blanket BOOLEAN, water_heater_incent CHARACTER VARYING(35), water_heater_incent_year INTEGER, lights_replaced BOOLEAN, lights_incent CHARACTER VARYING(35), lights_incent_year INTEGER, dishwasher_replaced BOOLEAN, dishwasher_incent CHARACTER VARYING(35), dishwasher_incent_year INTEGER, fridge_replaced BOOLEAN, fridge_incent CHARACTER VARYING(35), fridge_incent_year INTEGER, freezer_replaced BOOLEAN, freezer_incent CHARACTER VARYING(35), freezer_incent_year INTEGER, washer_replaced BOOLEAN, washer_incent CHARACTER VARYING(35), washer_incent_year INTEGER, renewable_energy CHARACTER VARYING(15), own_rent CHARACTER VARYING(10), sex CHARACTER VARYING(10), employment CHARACTER VARYING(25), live_with_spouse BOOLEAN, race CHARACTER VARYING(35), latino BOOLEAN, education CHARACTER VARYING(30), household_size INTEGER, member_1_age INTEGER, member_2_age INTEGER, member_3_age INTEGER, member_4_age INTEGER, member_5_age INTEGER, member_6_age INTEGER, member_7_age INTEGER, member_8_age INTEGER, member_9_age INTEGER, member_10_age INTEGER, member_11_age INTEGER, member_12_age INTEGER, member_13_age INTEGER, member_14_age INTEGER, income INTEGER, income_employment BOOLEAN, income_retirement BOOLEAN, income_ssi BOOLEAN, income_welfare BOOLEAN, income_investment BOOLEAN, income_other BOOLEAN, poverty_100 BOOLEAN, poverty_150 BOOLEAN, public_housing_authority BOOLEAN, food_stamps BOOLEAN, low_rent BOOLEAN, pays_electricity_heat CHARACTER VARYING(30), pays_electricity_water CHARACTER VARYING(30), pays_electricity_cooking CHARACTER VARYING(30), pays_electricity_cool CHARACTER VARYING(30), pays_electricity_lighting CHARACTER VARYING(30), pays_natural_gas_heat CHARACTER VARYING(30), pays_natural_gas_water CHARACTER VARYING(30), pays_natural_gas_cooking CHARACTER VARYING(30), pays_natural_gas_other CHARACTER VARYING(30), pays_fuel_oil CHARACTER VARYING(30), pays_propane CHARACTER VARYING(30), electricity_heat BOOLEAN, electricity_heat_2 BOOLEAN, electricity_cool BOOLEAN, electricity_water BOOLEAN, electricity_cooking BOOLEAN, electricity_other BOOLEAN, natural_gas_heat BOOLEAN, natural_gas_heat_2 BOOLEAN, natural_gas_water BOOLEAN, natural_gas_cooking BOOLEAN, natural_gas_other BOOLEAN, propane_heat BOOLEAN, propane_heat_2 BOOLEAN, propane_water BOOLEAN, propane_cooking BOOLEAN, propane_other BOOLEAN, fuel_oil_heat BOOLEAN, fuel_oil_heat_2 BOOLEAN, fuel_oil_water BOOLEAN, fuel_oil_other BOOLEAN, kerosene_heat BOOLEAN, kerosene_heat_2 BOOLEAN, kerosene_water BOOLEAN, kerosene_other BOOLEAN, wood_heat BOOLEAN, wood_heat_2 BOOLEAN, wood_water BOOLEAN, wood_other BOOLEAN, solar_heat BOOLEAN, solar_heat_2 BOOLEAN, solar_water BOOLEAN, solar_other BOOLEAN, other_heat BOOLEAN, other_heat_2 BOOLEAN, other_water BOOLEAN, other_cooking BOOLEAN, energy FLOAT, energy_units CHARACTER VARYING(10), energy_cost INTEGER, energy_cost_units CHARACTER VARYING(10), electricity FLOAT, electricity_units CHARACTER VARYING(10), electricity_cost INTEGER, electricity_cost_units CHARACTER VARYING(10), natural_gas FLOAT, natural_gas_units CHARACTER VARYING(10), natural_gas_cost INTEGER, natural_gas_cost_units CHARACTER VARYING(10), propane FLOAT, propane_units CHARACTER VARYING(10), propane_cost INTEGER, propane_cost_units CHARACTER VARYING(10), fuel_oil FLOAT, fuel_oil_units CHARACTER VARYING(10), fuel_oil_cost INTEGER, fuel_oil_cost_units CHARACTER VARYING(10), kerosene FLOAT, kerosene_units CHARACTER VARYING(10), kerosene_cost INTEGER, kerosene_cost_units CHARACTER VARYING(10), wood FLOAT, wood_units CHARACTER VARYING(10) ); EOS self.table_name = "recs_2009_responses" self.primary_key = "id" has_many :states, :foreign_key => :recs_grouping_id, :primary_key => :recs_grouping_id warn_if_nulls_except( :metro_micro, :converted_house, :condo_coop, :apartments, :building_floors, :garage_type, :garage_size, :basement_type, :attic_type, :roof_material, :heater, :heater_age, :heater_fuel, :heater_shared, :heater_portion, :heater_2, :heater_2_fuel, :heater_3, :heater_3_fuel, :heater_4, :heater_4_fuel, :heater_5, :heater_5_fuel, :heater_6, :heater_6_fuel, :cooler_central_age, :cooler_central_shared, :cooler_ac_age, :cooler_ac_energy_star, :water_heater, :water_heater_fuel, :water_heater_age, :water_heater_size, :water_heater_shared, :water_heater_2, :water_heater_2_fuel, :water_heater_2_age, :water_heater_2_size, :pool_fuel, :hot_tub_fuel, :cooking_fuel, :stove_fuel, :cooktop_fuel, :oven_fuel, :oven_type, :outdoor_grill_fuel, :indoor_grill_fuel, :fridge_type, :fridge_size, :fridge_defrost, :fridge_door_ice, :fridge_age, :fridge_energy_star, :fridge_2_type, :fridge_2_size, :fridge_2_defrost, :fridge_2_age, :fridge_2_energy_star, :fridge_3_type, :fridge_3_size, :fridge_3_defrost, :fridge_3_age, :fridge_3_energy_star, :freezer_type, :freezer_size, :freezer_defrost, :freezer_age, :freezer_2_type, :freezer_2_size, :freezer_2_defrost, :freezer_2_age, :dishwasher_age, :dishwasher_energy_star, :washer_type, :washer_age, :washer_energy_star, :dryer_fuel, :dryer_age, :tv_size, :tv_type, :tv_theater, :tv_2_size, :tv_2_type, :tv_2_theater, :tv_3_size, :tv_3_type, :tv_3_theater, :computer_type, :computer_monitor, :computer_2_type, :computer_2_monitor, :computer_3_type, :computer_3_monitor, :well_pump, :engine_block_heater, :heat_attic_portion, :heat_basement_portion, :heat_garage, :heat_temp_day, :heat_temp_day_units, :heat_temp_night, :heat_temp_night_units, :heat_temp_away, :heat_temp_away_units, :heat_auto_adjust_day, :heat_auto_adjust_night, :cool_attic_portion, :cool_basement_portion, :cool_garage, :cool_temp_day, :cool_temp_day_units, :cool_temp_night, :cool_temp_night_units, :cool_temp_away, :cool_temp_away_units, :cool_auto_adjust_day, :cool_auto_adjust_night, :cooler_central_use, :cooler_ac_use, :fan_use, :humidifier_use, :humidifier_use_units, :dehumidifier_use, :dehumidifier_use_units, :oven_use, :oven_use_units, :microwave_use, :microwave_defrost, :fridge_2_use, :fridge_2_use_units, :fridge_3_use, :fridge_3_use_units, :dishwasher_use, :dishwasher_use_units, :washer_use, :washer_use_units, :washer_temp_wash, :washer_temp_rinse, :dryer_use, :tv_weekday_use, :tv_weekday_use_units, :tv_weekend_use, :tv_weekend_use_units, :tv_2_weekday_use, :tv_2_weekday_use_units, :tv_2_weekend_use, :tv_2_weekend_use_units, :tv_3_weekday_use, :tv_3_weekday_use_units, :tv_3_weekend_use, :tv_3_weekend_use_units, :computer_use, :computer_use_units, :computer_idle, :computer_2_use, :computer_2_use_units, :computer_2_idle, :computer_3_use, :computer_3_use_units, :computer_3_idle, :tool_charging, :tool_vampires, :electronic_charging, :electronic_vampires, :energy_audit_year, :energy_audit_incent, :energy_audit_incent_year, :insulation_added_year, :insulation_incent, :insulation_incent_year, :caulking_added_year, :caulking_incent, :caulking_incent_year, :windows_replaced, :windows_incent, :windows_incent_year, :heater_maintained, :heater_replaced, :heater_incent, :heater_incent_year, :cooler_central_maintained, :cooler_central_replaced, :cooler_central_incent, :cooler_central_incent_year, :cooler_ac_replaced, :cooler_ac_incent, :cooler_ac_incent_year, :water_heater_blanket, :water_heater_incent, :water_heater_incent_year, :lights_replaced, :lights_incent, :lights_incent_year, :dishwasher_replaced, :dishwasher_incent, :dishwasher_incent_year, :fridge_replaced, :fridge_incent, :fridge_incent_year, :freezer_replaced, :freezer_incent, :freezer_incent_year, :washer_replaced, :washer_incent, :washer_incent_year, :renewable_energy, :own_rent, :member_2_age, :member_3_age, :member_4_age, :member_5_age, :member_6_age, :member_7_age, :member_8_age, :member_9_age, :member_10_age, :member_11_age, :member_12_age, :member_13_age, :member_14_age, :public_housing_authority, :low_rent, :pays_electricity_heat, :pays_electricity_water, :pays_electricity_cooking, :pays_electricity_cool, :pays_electricity_lighting, :pays_natural_gas_heat, :pays_natural_gas_water, :pays_natural_gas_cooking, :pays_natural_gas_other, :pays_fuel_oil, :pays_propane ) end