Sha256: 8c6b8dc7c7571d09844cf7b24c157a0170f5d74261665b6d56574318918599e5

Contents?: true

Size: 573 Bytes

Versions: 7

Compression:

Stored size: 573 Bytes

Contents

require 'earth/model'

require 'earth/automobile/automobile_make_year'

class AutomobileMake < ActiveRecord::Base
  extend Earth::Model

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE automobile_makes
  (
     name                  CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     fuel_efficiency       FLOAT,
     fuel_efficiency_units CHARACTER VARYING(255)
  );

EOS

  self.primary_key = "name"
  
  # for calculating fuel efficiency
  has_many :make_years, :foreign_key => :make_name, :primary_key => :name, :class_name => 'AutomobileMakeYear'
  
  warn_unless_size 81
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/automobile/automobile_make.rb
earth-1.1.2 lib/earth/automobile/automobile_make.rb
earth-1.1.1 lib/earth/automobile/automobile_make.rb
earth-1.1.0 lib/earth/automobile/automobile_make.rb
earth-1.0.3 lib/earth/automobile/automobile_make.rb
earth-1.0.2 lib/earth/automobile/automobile_make.rb
earth-1.0.1 lib/earth/automobile/automobile_make.rb