Sha256: 8694b58ef8ecf154082bca39e76df3e6df6895c9a319c302e1ea2729a8590def

Contents?: true

Size: 1.39 KB

Versions: 34

Compression:

Stored size: 1.39 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',                 :primary_key => 'iata_code'
  belongs_to :origin_airport,      :foreign_key => 'origin_airport_iata_code',          :primary_key => 'iata_code',     :class_name => 'Airport'
  belongs_to :destination_airport, :foreign_key => 'destination_airport_iata_code',     :primary_key => 'iata_code',     :class_name => 'Airport'
  belongs_to :aircraft,            :foreign_key => 'aircraft_bts_code',                 :primary_key => 'bts_code'
  
  falls_back_on :distance      => lambda { weighted_average(:distance,      :weighted_by => :passengers) }, # 2077.1205         data1 10-12-2010
                :seats         => lambda { weighted_average(:seats,         :weighted_by => :passengers) }, # 144.15653537046   data1 10-12-2010
                :load_factor   => lambda { weighted_average(:load_factor,   :weighted_by => :passengers) }, # 0.78073233770097  data1 10-12-2010
                :freight_share => lambda { weighted_average(:freight_share, :weighted_by => :passengers) }  # 0.022567224170157 data1 10-12-2010
  
  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

34 entries across 34 versions & 1 rubygems

Version Path
earth-0.4.12 lib/earth/air/flight_segment.rb
earth-0.4.11 lib/earth/air/flight_segment.rb
earth-0.4.10 lib/earth/air/flight_segment.rb
earth-0.4.9 lib/earth/air/flight_segment.rb
earth-0.4.8 lib/earth/air/flight_segment.rb
earth-0.4.7 lib/earth/air/flight_segment.rb
earth-0.4.6 lib/earth/air/flight_segment.rb
earth-0.4.5 lib/earth/air/flight_segment.rb
earth-0.4.4 lib/earth/air/flight_segment.rb
earth-0.4.3 lib/earth/air/flight_segment.rb
earth-0.4.2 lib/earth/air/flight_segment.rb
earth-0.4.1 lib/earth/air/flight_segment.rb
earth-0.4.0 lib/earth/air/flight_segment.rb
earth-0.3.15 lib/earth/air/flight_segment.rb
earth-0.3.14 lib/earth/air/flight_segment.rb
earth-0.3.13 lib/earth/air/flight_segment.rb
earth-0.3.11 lib/earth/air/flight_segment.rb
earth-0.3.10 lib/earth/air/flight_segment.rb
earth-0.3.9 lib/earth/air/flight_segment.rb
earth-0.3.8 lib/earth/air/flight_segment.rb