Sha256: 6fda946606cbd03d549cd96eb9583d0f6f85c4e09a7315c79f08052cab950084

Contents?: true

Size: 861 Bytes

Versions: 8

Compression:

Stored size: 861 Bytes

Contents

class AutomobileMakeYear < ActiveRecord::Base
  set_primary_key :name
  
  belongs_to :make,      :class_name => 'AutomobileMake',          :foreign_key => 'make_name'
  has_many :fleet_years, :class_name => 'AutomobileMakeFleetYear', :foreign_key => 'make_year_name'

  col :name
  col :make_name
  col :year, :type => :integer
  col :fuel_efficiency, :type => :float
  col :fuel_efficiency_units
  col :volume, :type => :integer # This will sometimes be null because not all make_years have CAFE data
  
  # FIXME TODO verify make_name and volume?
  
  # verify "Fuel efficiency should be greater than zero" do
  #   if violator = first(:conditions => ['fuel_efficiency IS NULL OR fuel_efficiency <= 0'])
  #     raise "Invalid fuel efficiency for AutomobileMakeYear #{record.name}: #{record.fuel_efficiency} (should be > 0)"
  #   end
  #   true
  # end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
earth-0.7.0 lib/earth/automobile/automobile_make_year.rb
earth-0.6.6 lib/earth/automobile/automobile_make_year.rb
earth-0.6.5 lib/earth/automobile/automobile_make_year.rb
earth-0.6.4 lib/earth/automobile/automobile_make_year.rb
earth-0.6.3 lib/earth/automobile/automobile_make_year.rb
earth-0.6.2 lib/earth/automobile/automobile_make_year.rb
earth-0.6.1 lib/earth/automobile/automobile_make_year.rb
earth-0.6.0 lib/earth/automobile/automobile_make_year.rb