Sha256: bb7148e06955f635f1206e781a4a85f90ac69e6f01c706e8e56531a512b8828f

Contents?: true

Size: 438 Bytes

Versions: 11

Compression:

Stored size: 438 Bytes

Contents

class FlightDistanceClass < ActiveRecord::Base
  set_primary_key :name
  
  def self.find_by_distance(distance)
    first :conditions => arel_table[:min_distance].lteq(distance.to_f).and(arel_table[:max_distance].gt(distance.to_f))
  end
  
  col :name
  col :distance, :type => :float
  col :distance_units
  col :min_distance, :type => :float
  col :min_distance_units
  col :max_distance, :type => :float
  col :max_distance_units
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
earth-0.11.10 lib/earth/air/flight_distance_class.rb
earth-0.11.9 lib/earth/air/flight_distance_class.rb
earth-0.11.8 lib/earth/air/flight_distance_class.rb
earth-0.11.7 lib/earth/air/flight_distance_class.rb
earth-0.11.6 lib/earth/air/flight_distance_class.rb
earth-0.11.5 lib/earth/air/flight_distance_class.rb
earth-0.11.4 lib/earth/air/flight_distance_class.rb
earth-0.11.3 lib/earth/air/flight_distance_class.rb
earth-0.11.2 lib/earth/air/flight_distance_class.rb
earth-0.11.1 lib/earth/air/flight_distance_class.rb
earth-0.11.0 lib/earth/air/flight_distance_class.rb