I have 2 questions regarding the gem 'geokit-rails'
This is my sample code
class Outlet < ActiveRecord::Base
acts_as_mappable :lat_column_name => :address_latitude,
:lng_column_name => :address_longitude,
:default_units => :kms
end
I cant use the find(:all)
sample
Outlet.find(:all, :origin =>[32.951613,-96.958444], :within=>10)
it returnsActiveRecord::RecordNotFound: Couldn't find all Outlets with 'id': (all, {:origin=>[32.951613, -96.958444], :within=>10})
I have also tested on this query
Outlet.find(:all)
it returnsActiveRecord::RecordNotFound: Couldn't find Outlet with 'id'=all
Distance. I dont really understand how does this work. Should we add distance column into the the outlet model ? If yes, whats the column type? And is that possible to return the record with the distance value based on the given lat lng ?
Outlet.by_distance(:origin =>[32.951613, -96.958444])
it will return the records with the distance to that point. (2kms, 3kms, 4km, ...)