Sha256: 77dfd3eabdfd93a0aa117fcaa309ec399c6cfd8dbe854d98039fb2e11da2eca0

Contents?: true

Size: 1020 Bytes

Versions: 7

Compression:

Stored size: 1020 Bytes

Contents

require 'earth/model'

require 'earth/fuel/fuel'

class FuelYear < ActiveRecord::Base
  extend Earth::Model

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE fuel_years
  (
     name                               CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     fuel_name                          CHARACTER VARYING(255),
     year                               INTEGER,
     energy_content                     FLOAT,
     energy_content_units               CHARACTER VARYING(255),
     carbon_content                     FLOAT,
     carbon_content_units               CHARACTER VARYING(255),
     oxidation_factor                   FLOAT,
     biogenic_fraction                  FLOAT,
     co2_emission_factor                FLOAT,
     co2_emission_factor_units          CHARACTER VARYING(255),
     co2_biogenic_emission_factor       FLOAT,
     co2_biogenic_emission_factor_units CHARACTER VARYING(255)
  );

EOS

  self.primary_key = "name"
  
  belongs_to :fuel, :foreign_key => 'fuel_name'
  
  warn_unless_size 171
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/fuel/fuel_year.rb
earth-1.1.2 lib/earth/fuel/fuel_year.rb
earth-1.1.1 lib/earth/fuel/fuel_year.rb
earth-1.1.0 lib/earth/fuel/fuel_year.rb
earth-1.0.3 lib/earth/fuel/fuel_year.rb
earth-1.0.2 lib/earth/fuel/fuel_year.rb
earth-1.0.1 lib/earth/fuel/fuel_year.rb