Sha256: b6729bb63dc850205481fc3e1b5b1d8618f83191ab2bb91741fd4ec404c57e3c

Contents?: true

Size: 664 Bytes

Versions: 3

Compression:

Stored size: 664 Bytes

Contents

require 'earth/model'

require 'earth/air/flight_segment'

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

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE airlines
  (
     name           CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     secondary_name CHARACTER VARYING(255),
     bts_code       CHARACTER VARYING(255),
     iata_code      CHARACTER VARYING(255),
     icao_code      CHARACTER VARYING(255)
  );

EOS

  self.primary_key = "name"
  
  has_many :flight_segments,
    :primary_key => :bts_code,
    :foreign_key => :airline_bts_code
  
  warn_unless_size 1524 # this is overridden in data1, which imports extra airlines from proprietary data
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
earth-1.0.3 lib/earth/air/airline.rb
earth-1.0.2 lib/earth/air/airline.rb
earth-1.0.1 lib/earth/air/airline.rb