Sha256: 1521b9a40505e9548623ba1887d63542b7c7269b166e79df5e04761d2d1c7bf1

Contents?: true

Size: 1.35 KB

Versions: 16

Compression:

Stored size: 1.35 KB

Contents

class Aircraft < ActiveRecord::Base
  set_primary_key :bp_code
  
  belongs_to :manufacturer,   :foreign_key => 'manufacturer_name', :primary_key => 'name',     :class_name => 'AircraftManufacturer'
  belongs_to :aircraft_class, :foreign_key => 'class_code',        :primary_key => 'code'
  has_many   :segments,       :foreign_key => 'aircraft_bts_code', :primary_key => 'bts_code', :class_name => 'FlightSegment'
  
  falls_back_on :m3            => lambda { weighted_average(:m3,            :weighted_by => [:segments, :passengers]) }, # 9.73423082858437e-08   r7110: 8.6540464368905e-8      r6972: 8.37e-8
                :m2            => lambda { weighted_average(:m2,            :weighted_by => [:segments, :passengers]) }, # -0.000134350543484608  r7110: -0.00015337661447817    r6972: -4.09e-5
                :m1            => lambda { weighted_average(:m1,            :weighted_by => [:segments, :passengers]) }, # 6.7728101555467        r7110: 4.7781966869412         r6972: 7.85
                :endpoint_fuel => lambda { weighted_average(:endpoint_fuel, :weighted_by => [:segments, :passengers]) }  # 1527.81790006167       r7110: 1065.3476555284         r6972: 1.72e3
  
  data_miner do
    tap "Brighter Planet's sanitized aircraft data", Earth.taps_server
    
    process "pull dependencies" do
      run_data_miner_on_belongs_to_associations
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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