Sha256: 442b7548483ebf503e14a2663cbc775df94864ea6cb2424ab50e119d078c57bd
Contents?: true
Size: 1.75 KB
Versions: 13
Compression:
Stored size: 1.75 KB
Contents
class Fuel < ActiveRecord::Base set_primary_key :name has_many :fuel_years, :foreign_key => 'fuel_name' data_miner do tap "Brighter Planet's fuels data", Earth.taps_server end def latest_year fuel_years.find_by_year(fuel_years.maximum('year')) end def energy_content if content = super content elsif fuel_years.present? latest_year.energy_content end end def energy_content_units if units = super units elsif fuel_years.present? latest_year.energy_content_units end end def carbon_content if content = super content elsif fuel_years.present? latest_year.carbon_content end end def carbon_content_units if units = super units elsif fuel_years.present? latest_year.carbon_content_units end end def oxidation_factor if oxidation_factor = super oxidation_factor elsif fuel_years.present? latest_year.oxidation_factor end end def biogenic_fraction if biogenic_fraction = super biogenic_fraction elsif fuel_years.present? latest_year.biogenic_fraction end end def co2_emission_factor if ef = super ef elsif fuel_years.present? latest_year.co2_emission_factor end end def co2_emission_factor_units if units = super units elsif fuel_years.present? latest_year.co2_emission_factor_units end end def co2_biogenic_emission_factor if ef = super ef elsif fuel_years.present? latest_year.co2_biogenic_emission_factor end end def co2_biogenic_emission_factor_units if units = super units elsif fuel_years.present? latest_year.co2_biogenic_emission_factor_units end end end
Version data entries
13 entries across 13 versions & 1 rubygems