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.1.2 lib/earth/locality/urbanity.rb
earth-0.1.1 lib/earth/locality/urbanity.rb
earth-0.1.0 lib/earth/locality/urbanity.rb
earth-0.0.43 lib/earth/locality/urbanity.rb
earth-0.0.42 lib/earth/locality/urbanity.rb
earth-0.0.41 lib/earth/locality/urbanity.rb
earth-0.0.40 lib/earth/locality/urbanity.rb
earth-0.0.39 lib/earth/locality/urbanity.rb
earth-0.0.38 lib/earth/locality/urbanity.rb
earth-0.0.37 lib/earth/locality/urbanity.rb
earth-0.0.36 lib/earth/locality/urbanity.rb
earth-0.0.35 lib/earth/locality/urbanity.rb
earth-0.0.34 lib/earth/locality/urbanity.rb
earth-0.0.33 lib/earth/locality/urbanity.rb
earth-0.0.32 lib/earth/locality/urbanity.rb
earth-0.0.31 lib/earth/locality/urbanity.rb
earth-0.0.30 lib/earth/locality/urbanity.rb
earth-0.0.29 lib/earth/locality/urbanity.rb
earth-0.0.28 lib/earth/locality/urbanity.rb
earth-0.0.27 lib/earth/locality/urbanity.rb