Sha256: d3788643ca2b7ae687dae7136dc55fdbfc55897575c347e9ff0a1dda3a556b03

Contents?: true

Size: 664 Bytes

Versions: 2

Compression:

Stored size: 664 Bytes

Contents

class Airline < ActiveRecord::Base
  set_primary_key :iata_code

#  has_many :airline_aircraft, :class_name => 'AirlineAircraft'
#  has_many :seat_classes, :class_name => 'AirlineSeatClass'
  has_many :segments, :class_name => "FlightSegment", :foreign_key => 'airline_iata_code'
#  has_many :airline_aircraft_seat_classes, :class_name => 'AirlineAircraftSeatClass'

  
  class << self
    def loose_search_columns
      @_loose_search_columns ||= [primary_key, :name]
    end
  
    # search by name
    def loose_right_reader
      @_loose_right_reader ||= lambda { |record| record[1] }
    end
  end
  
  def all_flights_domestic?
    !international?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flight-0.0.5 lib/test_support/data_models/airline.rb
flight-0.0.4 lib/test_support/data_models/airline.rb