Module: Geocoder::Store::ActiveRecord::ClassMethods

Defined in:
lib/geocoder/stores/active_record.rb

Overview

Methods which will be class methods of the including class.

Instance Method Summary collapse

Instance Method Details

#distance_from_sql(location, *args) ⇒ Object



83
84
85
86
87
88
# File 'lib/geocoder/stores/active_record.rb', line 83

def distance_from_sql(location, *args)
  latitude, longitude = Geocoder::Calculations.extract_coordinates(location)
  if Geocoder::Calculations.coordinates_present?(latitude, longitude)
    distance_sql(latitude, longitude, *args)
  end
end