Sha256: 3b9f24f7353b4c52aa3b1148655ccbbd602849792c0567711342abda72258a4b

Contents?: true

Size: 442 Bytes

Versions: 4

Compression:

Stored size: 442 Bytes

Contents

class FlightDistanceClass < ActiveRecord::Base
  self.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

4 entries across 4 versions & 1 rubygems

Version Path
earth-0.11.14 lib/earth/air/flight_distance_class.rb
earth-0.11.13 lib/earth/air/flight_distance_class.rb
earth-0.11.12 lib/earth/air/flight_distance_class.rb
earth-0.11.11 lib/earth/air/flight_distance_class.rb