lib/earth/bus/bus_fuel_control.rb in earth-0.12.4 vs lib/earth/bus/bus_fuel_control.rb in earth-1.0.0
- old
+ new
@@ -1,13 +1,25 @@
+require 'earth/model'
+
require 'earth/fuel'
class BusFuelControl < ActiveRecord::Base
+ extend Earth::Model
+
+ TABLE_STRUCTURE = <<-EOS
+
+CREATE TABLE bus_fuel_controls
+ (
+ name CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
+ bus_fuel_name CHARACTER VARYING(255),
+ control CHARACTER VARYING(255),
+ ch4_emission_factor FLOAT,
+ ch4_emission_factor_units CHARACTER VARYING(255),
+ n2o_emission_factor FLOAT,
+ n2o_emission_factor_units CHARACTER VARYING(255)
+ );
+
+EOS
+
self.primary_key = "name"
- col :name
- col :bus_fuel_name
- col :control
- col :ch4_emission_factor, :type => :float
- col :ch4_emission_factor_units
- col :n2o_emission_factor, :type => :float
- col :n2o_emission_factor_units
warn_unless_size 9
end