lib/models/trip_leg.rb in fossil-0.5.9 vs lib/models/trip_leg.rb in fossil-0.5.10

- old
+ new

@@ -67,12 +67,13 @@ many_to_one :departure_transport_comment, :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"=>41) } many_to_one :arrival_transport_comment, :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"=>36) } many_to_one :departure_general_comment, :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"=>183) } many_to_one :arrival_general_comment, :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"=>185) } - 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"]) } + many_to_one :limo_comment, :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_transport_comment, :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[:"crewlimo comment"]) } + many_to_one :crew_fbo_comment, :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 o_to_n :crew_legs, :class=>:CrewLeg, :prefix=>'trip leg' o_to_n :audit_trails, :class=>:AuditTrail, :prefix=>'owner' o_to_n :flight_log_expenses, :class=>:FlightLogExpense, :prefix=>'trip leg' @@ -798,12 +799,17 @@ return "VERI" if verify_date > 0 return "FLOG" if status != 1 and flight_time_actual > 0 case status when 0 then "SCHED" when 1 then "VERI" - when 10 then "CANC" - when 23 then "CANC" - when 21 then "MAINT" + when 10,23 then "CANC" + when 21 then + case leg_type_code + when 7 then "UMAINT" + when 103 then "SMAINT" +# when 113 then "RMAINT" + else "MAINT" + end when 20 then "SCHED" #really is "RESVD" else "[#{status}]"; end end \ No newline at end of file