class Airport < Sequel::Model(:'airport') # NOTE - Count of instances as of 06/01/2009 => 28304 # Associations #~ one_to_many :trip_leg_arrivals, :class=>:TripLeg, :key=>nil, :dataset=>proc{TripLeg.filter(:'arrival-icao/iata/id'=>1, :'arrival icao'=>self[:'icao']).union(TripLeg.filter(:'arrival-icao/iata/id'=>2, :'arrival iata'=>self[:'iata'])).union(TripLeg.filter(:'arrival-icao/iata/id'=>3, :'arrival a/p prefix'.like("%#{self[:'airport id prefix']}"), :'arrival airport id'.like("%#{self[:'airport id']}")))} one_to_many :trip_leg_arrivals, :class=>:TripLeg, :key=>nil, :dataset=>proc{TripLeg.filter(:'arrival-icao/iata/id'=>1, :'arrival icao'=>self[:'icao']).union(TripLeg.filter(:'arrival-icao/iata/id'=>2, :'arrival iata'=>self[:'iata'])).union(TripLeg.filter(:'arrival a/p prefix'.like("%#{self[:'airport id prefix']}"), :'arrival airport id'.like("%#{self[:'airport id']}"), :'arrival-icao/iata/id'=>3))} #~ one_to_many :trip_leg_departures, :class=>:TripLeg, :key=>nil, :dataset=>proc{TripLeg.filter(:'depart-icao/iata/id'=>1, :'departure icao'=>self[:'icao']).union(TripLeg.filter(:'depart-icao/iata/id'=>2, :'departure iata'=>self[:'iata'])).union(TripLeg.filter(:'depart-icao/iata/id'=>3, :'depart a/p prefix'.like("%#{self[:'airport id prefix']}"), :'depart airport id'.like("%#{self[:'airport id']}")))} one_to_many :airport_fbos, :class=>:AirportFbo, :key=>nil, :dataset=>proc{ map = Airport.filter(:iata=>iata).graph( AirportFbo, {:'airport kid - date'=>:kid_date, :'airport kid - time'=>:kid_time,:'airport kid - user'=>:kid_user,:'airport kid - mult'=>:kid_mult,:'airport kid - comm'=>:kid_comm}, :table_alias=>:fbo); result = map.inject([]){|array, hash| array<