Module: Geocoder::ClassMethods
- Defined in:
- lib/geocoder.rb
Overview
Methods which will be class methods of the including class.
Instance Method Summary collapse
-
#near_scope_options(latitude, longitude, radius = 20, options = {}) ⇒ Object
Get options hash suitable for passing to ActiveRecord.find to get records within a radius (in miles) of the given point.
Instance Method Details
#near_scope_options(latitude, longitude, radius = 20, options = {}) ⇒ Object
Get options hash suitable for passing to ActiveRecord.find to get records within a radius (in miles) of the given point. Options hash may include:
order-
column(s) for ORDER BY SQL clause
limit-
number of records to return (for LIMIT SQL clause)
offset-
number of records to skip (for OFFSET SQL clause)
select-
string with the SELECT SQL fragment (e.g. “id, name”)
57 58 59 60 61 62 63 |
# File 'lib/geocoder.rb', line 57 def (latitude, longitude, radius = 20, = {}) if ActiveRecord::Base.connection.adapter_name == "SQLite" (latitude, longitude, radius, ) else (latitude, longitude, radius, ) end end |