Sha256: 14e84aa4b5e6c5c7029c3c7944075fa4e6c6e42fe90aedeb637431dc341bf0a6

Contents?: true

Size: 1.76 KB

Versions: 29

Compression:

Stored size: 1.76 KB

Contents

class FlightSegment < ActiveRecord::Base
  set_primary_key :row_hash
  
  extend CohortScope
  self.minimum_cohort_size = 1
  
  belongs_to :airline,             :foreign_key => 'airline_iata_code'
  belongs_to :origin_airport,      :foreign_key => "origin_airport_iata_code",     :class_name => 'Airport'
  belongs_to :destination_airport, :foreign_key => "dest_airport_iata_code",       :class_name => 'Airport'
  belongs_to :origin_country,      :foreign_key => 'origin_country_iso_3166_code', :class_name => 'Country'
  belongs_to :destination_country, :foreign_key => 'dest_country_iso_3166_code',   :class_name => 'Country'
  belongs_to :aircraft,            :foreign_key => 'bts_aircraft_type_code',                                              :primary_key => 'bts_aircraft_type_code'
  belongs_to :propulsion,                                                          :class_name => 'FlightPropulsion'
  belongs_to :configuration,                                                       :class_name => 'FlightConfiguration'
  belongs_to :service_class,                                                       :class_name => 'FlightService'
  belongs_to :domesticity,                                                         :class_name => 'FlightDomesticity'
  
  falls_back_on :load_factor =>   lambda { weighted_average(:load_factor,   :weighted_by => :passengers) }, # 0.78222911236768
                :freight_share => lambda { weighted_average(:freight_share, :weighted_by => :passengers) },  # 0.024017329363736
                :seats => lambda { weighted_average :seats, :weighted_by => :passengers }

  data_miner do
    tap "Brighter Planet's sanitized T100 data", Earth.taps_server
    
    process "pull dependencies" do
      run_data_miner_on_belongs_to_associations
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
earth-0.2.4 lib/earth/air/flight_segment.rb
earth-ruby19-0.2.3 lib/earth/air/flight_segment.rb
earth-0.2.3 lib/earth/air/flight_segment.rb
earth-0.2.2 lib/earth/air/flight_segment.rb
earth-0.2.1 lib/earth/air/flight_segment.rb
earth-0.2.0 lib/earth/air/flight_segment.rb
earth-0.1.4 lib/earth/air/flight_segment.rb
earth-0.1.3 lib/earth/air/flight_segment.rb
earth-0.1.2 lib/earth/air/flight_segment.rb
earth-0.1.1 lib/earth/air/flight_segment.rb
earth-0.1.0 lib/earth/air/flight_segment.rb
earth-0.0.43 lib/earth/air/flight_segment.rb
earth-0.0.42 lib/earth/air/flight_segment.rb
earth-0.0.41 lib/earth/air/flight_segment.rb
earth-0.0.40 lib/earth/air/flight_segment.rb
earth-0.0.39 lib/earth/air/flight_segment.rb
earth-0.0.38 lib/earth/air/flight_segment.rb
earth-0.0.37 lib/earth/air/flight_segment.rb
earth-0.0.36 lib/earth/air/flight_segment.rb
earth-0.0.35 lib/earth/air/flight_segment.rb