Sha256: 3874a9ab5daad3a2e39c56e0be0ec15fa1727741333922b8cfb6f53d3e51eda2

Contents?: true

Size: 938 Bytes

Versions: 8

Compression:

Stored size: 938 Bytes

Contents

class AutomobileMake < ActiveRecord::Base
  set_primary_key :name
  
  has_many :make_years,               :class_name => 'AutomobileMakeYear',             :foreign_key => 'make_name'
  has_many :models,                   :class_name => 'AutomobileMakeModel',            :foreign_key => 'make_name'
  has_many :fleet_years,              :class_name => 'AutomobileMakeFleetYear',        :foreign_key => 'make_name'
  has_many :make_model_year_variants, :class_name => 'AutomobileMakeModelYearVariant', :foreign_key => 'make_name'

  col :name
  col :fuel_efficiency, :type => :float
  col :fuel_efficiency_units

  # TODO convert to table_warnings
  # verify "Fuel efficiency should be greater than zero" do
  #   AutomobileMake.all.each do |make|
  #     unless make.fuel_efficiency > 0
  #       raise "Invalid fuel efficiency for AutomobileMake #{make.name}: #{make.fuel_efficiency} (should be > 0)"
  #     end
  #   end
  # end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

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