位置有 :lat 和 :lng 用于“geokit-rails”我正在运行 Rails 4。
是否可以查询在指定位置范围内具有轨道的不同集合?
class Location < ActiveRecord::Base
belongs_to :locatable, polymorphic: true
acts_as_mappable
end
class Tracks < ActiveRecord::Base
has_one :location, as: :locatable
belongs_to :collection
end
class Collection < ActiveRecord::Base
belongs_to :user
has_many :tracks
end