Sha256: 2d63a2cff7b654b268d53f001b01e850caa22271d9ab4b9d4b0e4d0c35784ecf

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

module BrighterPlanet
  module Flight
    module Relationships
      def self.included(target)
        target.belongs_to :distance_class,      :class_name => 'FlightDistanceClass', :foreign_key => 'name'
        target.belongs_to :fuel_type,                                                 :foreign_key => 'name'
        target.belongs_to :seat_class,          :class_name => 'FlightSeatClass',     :foreign_key => 'name'
        target.belongs_to :country,                                                   :foreign_key => 'iso_3166_code'
        target.belongs_to :origin_airport,      :class_name => 'Airport'
        target.belongs_to :destination_airport, :class_name => 'Airport'
        target.belongs_to :aircraft,                                                  :foreign_key => 'icao_code'
        target.belongs_to :aircraft_class,                                            :foreign_key => 'brighter_planet_aircraft_class_code'
        target.belongs_to :airline,                                                   :foreign_key => 'iata_code'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flight-0.1.4 lib/flight/relationships.rb
flight-0.1.3 lib/flight/relationships.rb
flight-0.1.2 lib/flight/relationships.rb
flight-0.1.1 lib/flight/relationships.rb
flight-0.1.0 lib/flight/relationships.rb