lib/models/trip_leg.rb in fossil-0.4.0 vs lib/models/trip_leg.rb in fossil-0.4.1

- old
+ new

@@ -42,9 +42,10 @@ many_to_one :departure_airport, :class=>:Airport, :key=>:departure_icao, :primary_key=>:icao #:key=>nil, :dataset=>proc{ ref_method = self[:'depart-icao/iata/id']; case ref_method; when 1 then Airport.filter(:'icao'=>self[:'departure icao']); when 2 then Airport.filter(:'iata'=>self[:'departure iata']); else Airport.filter(:'airport id prefix'.like("%#{self[:'depart a/p prefix']}"), :'airport id'.like("%#{self[:'depart airport id']}")); end } many_to_one :alternate_arrival_airport, :class=>:Airport, :key=>nil, :dataset=>proc{ Airport.filter(:'airport id prefix'.like("%#{self[:'arr alt prefix']}"), :'airport id'.like( "%#{self[:'arr alt id']}"))} many_to_one :alternate_departure_airport, :class=>:Airport, :key=>nil, :dataset=>proc{ Airport.filter(:'airport id prefix'.like("%#{self[:'dep alt prefix']}"), :'airport id'.like( "%#{self[:'dep alt id']}"))} many_to_one :comment_value, :class=>:Comment, :key=>primary_key#, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"kid - comm"]) } many_to_one :departure_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"fueler comment"]) } + many_to_one :arrival_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"fbo comment"]) } many_to_one :catering_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"catering comment"]) } many_to_one :limo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"limo comment"]) } many_to_one :crew_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"mics serv 2 comment"]) } # One to many associations with composite primary keys \ No newline at end of file