lib/earth/air/aircraft_class.rb in earth-0.4.12 vs lib/earth/air/aircraft_class.rb in earth-0.5.0

- old
+ new

@@ -1,8 +1,16 @@ class AircraftClass < ActiveRecord::Base set_primary_key :code - # has_many :aircraft, :foreign_key => 'class_code', :primary_key => 'code' + has_many :aircraft, :foreign_key => 'class_code', :primary_key => 'code' + + def fuel_use_coefficients + [m3, m2, m1, b] + end + + def valid_fuel_use_equation? + fuel_use_coefficients.all?(&:present?) and fuel_use_coefficients.any?(&:nonzero?) + end data_miner do tap "Brighter Planet's aircraft class data", Earth.taps_server end end