Sha256: 1461004ba1612458d86e0b784ca603a9a0afb3844d8daafd52d5c0fd03a37ad2

Contents?: true

Size: 655 Bytes

Versions: 28

Compression:

Stored size: 655 Bytes

Contents

class Urbanity < ActiveRecord::Base
  set_primary_key :name
  
  has_many :residences
  has_many :residential_energy_consumption_survey_responses

  data_miner do
    schema do
      string :name
    end

    process "derive from ResidentialEnergyConsumptionSurveyResponse" do
      ResidentialEnergyConsumptionSurveyResponse.run_data_miner!
      connection.execute %{
        INSERT IGNORE INTO urbanities(name)
        SELECT DISTINCT residential_energy_consumption_survey_responses.urbanity_id FROM residential_energy_consumption_survey_responses WHERE LENGTH(residential_energy_consumption_survey_responses.urbanity_id) > 0
      }
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
earth-0.0.26 lib/earth/locality/urbanity.rb
earth-0.0.24 lib/earth/locality/urbanity.rb
earth-0.0.23 lib/earth/locality/urbanity.rb
earth-0.0.22 lib/earth/locality/urbanity.rb
earth-0.0.21 lib/earth/locality/urbanity.rb
earth-0.0.20 lib/earth/locality/urbanity.rb
earth-0.0.19 lib/earth/locality/urbanity.rb
earth-0.0.18 lib/earth/locality/urbanity.rb