I'm having a route
model
class Route < ActiveRecord::Base
has_many :etapes
acts_as_mappable :through => :steps
end
and a step
one (that contains lat and lgn)
class Step ActiveRecord::Base
belongs_to :route
acts_as_mappable
end
Actually, I can get the routes passing close to one point with the in_range
scope : Route.joins(:steps).in_range(0..15, :origin => [lat, lng]).group(:id)
I'm trying to get the route
passing close to 2 steps
, acts_as_mappable
does not have the scope I need, so I'm wondering what the best way to go ?