Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if @search_params[:unloading_point].present? && !@search_params[:unloading_point].empty?
- coordinates = @search_params[:unloading_point].map { |point| Geocoder.search(point).first.coordinates }
- array_scope = scope.where("ST_DWithin(load_lonlat, ?, 100.0)", @geofactory.point(*coordinates.first))
- coordinates.drop(1).each do |point|
- binding.pry
- array_scope = array_scope.or(scope.where("ST_DWithin(unload_lonlat, 'POINT(? ?)', 100.0)", *point))
- binding.pry
- end
- binding.pry
- scope = array_scope
- binding.pry
- end
Add Comment
Please, Sign In to add comment