Class: AutomobileTypeFuel
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AutomobileTypeFuel
- Extended by:
- Earth::Model
- Defined in:
- lib/earth/automobile/automobile_type_fuel.rb
Constant Summary collapse
- TABLE_STRUCTURE =
"\nCREATE TABLE automobile_type_fuels\n (\n name CHARACTER VARYING(255) NOT NULL PRIMARY KEY,\n type_name CHARACTER VARYING(255),\n fuel_family CHARACTER VARYING(255),\n annual_distance FLOAT,\n annual_distance_units CHARACTER VARYING(255),\n fuel_consumption FLOAT,\n fuel_consumption_units CHARACTER VARYING(255),\n ch4_emission_factor FLOAT,\n ch4_emission_factor_units CHARACTER VARYING(255),\n n2o_emission_factor FLOAT,\n n2o_emission_factor_units CHARACTER VARYING(255),\n vehicles FLOAT\n );\n\n"
Instance Method Summary collapse
-
#latest_activity_year_type_fuel ⇒ Object
for calculating vehicles.
Methods included from Earth::Model
extend_mining, extended, registry
Instance Method Details
#latest_activity_year_type_fuel ⇒ Object
for calculating vehicles
31 32 33 |
# File 'lib/earth/automobile/automobile_type_fuel.rb', line 31 def latest_activity_year_type_fuel AutomobileActivityYearTypeFuel.latest.where(:type_name => type_name, :fuel_family => fuel_family).first end |