geokit / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.
MIT License
1.57k stars 245 forks source link

Geokit is called twice for a query #66

Closed rdudacz closed 9 years ago

rdudacz commented 9 years ago

Hi guys,

I am calling a simple query:

`@cars = Car.includes(:services).within(distance, origin: city).paginate(:page => params[:page], :per_page => 100)`

And when I take a look to the log, I see there following:

Geokit is using the domain: localhost
Multi geocoding. address: New York, NY, United States, args []
Google geocoding. address: New York, NY, United States, args []
Google geocoding. Result: %7B%0A.....
Geokit is using the domain: localhost
Multi geocoding. address: New York, NY, United States, args []
Google geocoding. address: New York, NY, United States, args []
Google geocoding. Result: %7B%0A.....

Why is this output twice for every call I make? I checked the code there shouldn't be any duplicity.

In Gemfile: gem 'geokit-rails'

Thanks, Radek