Sha256: 376a0778c8bd9a955999e0b01b73d17b632fd7b08f70e4febe1abbd97b760b44

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

require 'earth/fuel'
class AutomobileTypeFuelYearControl < ActiveRecord::Base
  self.primary_key = "name"
  
  col :name
  col :type_name
  col :fuel_common_name
  col :year, :type => :integer
  col :control_name
  col :total_travel_percent, :type => :float
  
  # %w{ type_name fuel_common_name control_name type_fuel_control_name type_fuel_year_name }.each do |attribute|
  #   verify "#{attribute.humanize} should never be missing" do
  #     AutomobileTypeFuelYearControl.all.each do |record|
  #       value = record.send(:"#{attribute}")
  #       unless value.present?
  #         raise "Missing #{attribute.humanize.downcase} for AutomobileTypeFuelYearControl '#{record.name}'"
  #       end
  #     end
  #   end
  # end
  # 
  # verify "Year should be from 1990 to 2008" do
  #   AutomobileTypeFuelYearControl.all.each do |record|
  #     year = record.send(:year)
  #     unless year > 1989 and year < 2009
  #       raise "Invalid year for AutomobileTypeFuelYearControl '#{record.name}': #{year} (should be from 1990 to 2008)"
  #     end
  #   end
  # end
  
  # FIXME TODO verify "Total travel percent for each type fuel year should sum to one"
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
earth-0.11.20 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.19 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.18 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.17 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.16 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.15 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.14 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.13 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.12 lib/earth/automobile/automobile_type_fuel_year_control.rb
earth-0.11.11 lib/earth/automobile/automobile_type_fuel_year_control.rb