Sha256: 96a6e1caa32b90005e3d42f795804bfe746f1bb7a25b1a5b43fcf80afd52c876

Contents?: true

Size: 1.56 KB

Versions: 5

Compression:

Stored size: 1.56 KB

Contents

################################################################################
#
# This TripLeg is overriding the TripLeg model in fossil that usually would go to fos.
# It is pulling data from the mysql in memory database which is a copy of the fos
# trip leg table but with an added id column, and single ids for all foreign keys,
# so the associations are all rewritten to use the single primary key.
# The other methods are special methods for datamart trip_leg summary table
#
class TripLeg
  one_to_many :crew_legs, :class=>:CrewLeg, :key=>:trip_leg_id, :primary_key=>:id
  one_to_many :flight_log_expenses, :class=>:FlightLogExpense, :key=>:trip_leg_id, :primary_key=>:id
  many_to_one :trip, :class=>:Trip, :key=>:trips_id
  many_to_one :arrival_fbo, :class=>:AirportFbo, :key=>:fbo_id
  many_to_one :departure_fbo, :class=>:AirportFbo, :key=>:fueler_id
  many_to_one :trip_requester, :class=>:Passenger, :key=>:requester_id
  many_to_one :leg_requestor, :class=>:Passenger, :key=>:leg_req_id
  many_to_one :departure_catering_comment,  :class=>:Comment,  :key=>:departure_catering_comment_id
  many_to_one :arrival_catering_comment,    :class=>:Comment,  :key=>:arrival_catering_comment_id
  many_to_one :departure_transport_comment, :class=>:Comment,  :key=>:departure_transport_comment_id
  many_to_one :arrival_transport_comment,   :class=>:Comment,  :key=>:arrival_transport_comment_id
  many_to_one :departure_general_comment,   :class=>:Comment,  :key=>:departure_general_comment_id
  many_to_one :arrival_general_comment,     :class=>:Comment,  :key=>:arrival_general_comment_id
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fossil-0.5.11 lib/dbr_models/trip_leg.rb
fossil-0.5.10 lib/dbr_models/trip_leg.rb
fossil-0.5.9 lib/dbr_models/trip_leg.rb
fossil-0.5.8 lib/dbr_models/trip_leg.rb
fossil-0.5.7 lib/dbr_models/trip_leg.rb