Pr0d1r2-geokit 1.3.2.2 → 1.3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +12 -9
- data/lib/geokit.rb +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -217,22 +217,25 @@ It requires rspec and rspec-rails to operate.
|
|
217
217
|
|
218
218
|
First You need to generate some code:
|
219
219
|
|
220
|
-
./script/generate geokit_cached
|
220
|
+
./script/generate geokit_cached
|
221
221
|
|
222
222
|
One change to active record model storing the cache (generate does not generate this):
|
223
223
|
|
224
|
-
class CachedLocation < ActiveRecord::Base
|
225
|
-
|
226
|
-
end
|
224
|
+
class CachedLocation < ActiveRecord::Base
|
225
|
+
include Geokit::Cached::Model
|
226
|
+
end
|
227
227
|
|
228
228
|
You can enable it in Your models:
|
229
229
|
|
230
|
-
class Profile < ActiveRecord::Base
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
end
|
230
|
+
class Profile < ActiveRecord::Base
|
231
|
+
include Geokit::Cached::Geocodable
|
232
|
+
CACHE_LOCATIONS = true
|
233
|
+
before_save :geocode_address_cached
|
234
|
+
end
|
235
|
+
|
236
|
+
Or You can use it by hand:
|
235
237
|
|
238
|
+
@geo = Geokit::Geocoders::CachedMultiGeocoder.geocode("address, country")
|
236
239
|
|
237
240
|
## GOOGLE GROUP
|
238
241
|
|
data/lib/geokit.rb
CHANGED