Class: ClothesMachineUse

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/earth/residence/clothes_machine_use.rb

Class Method Summary collapse

Class Method Details

.derive_annual_energy_from_electricity_for_clothes_driersObject



8
9
10
11
12
13
14
15
# File 'lib/earth/residence/clothes_machine_use.rb', line 8

def derive_annual_energy_from_electricity_for_clothes_driers
  find_in_batches do |batch|
    batch.each do |record|
      record.annual_energy_from_electricity_for_clothes_driers = ResidenceSurveyResponse.cohort(:clothes_drier_use => record).weighted_average :annual_energy_from_electricity_for_clothes_driers
      record.save
    end
  end
end