Pr0d1r2-geokit 1.3.2.4 → 1.3.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ module Geokit
17
17
  end
18
18
 
19
19
  def geocode_address_cached
20
- multi_geocoder.geocode(complete_address)
20
+ @geo = multi_geocoder.geocode(complete_address)
21
21
  self.lat, self.lng, self.provider = @geo.lat, @geo.lng, @geo.provider if @geo.success
22
22
  end
23
23
 
@@ -25,7 +25,7 @@ module Geokit
25
25
 
26
26
  def fake_geoloc
27
27
  geoloc = Geokit::GeoLoc.new
28
- geoloc.lat, geoloc.lng, geoloc.provider, geoloc.success = lat, lng, provider, true
28
+ geoloc.lat, geoloc.lng, geoloc.provider, geoloc.success = lat, lng, provider, success?
29
29
  geoloc
30
30
  end
31
31
 
@@ -53,6 +53,10 @@ module Geokit
53
53
  !@geo.nil?
54
54
  end
55
55
 
56
+ def success?
57
+ !!(lat and lng)
58
+ end
59
+
56
60
  end
57
61
  end
58
62
  end
@@ -2,7 +2,7 @@ module Geokit
2
2
  module Geocoders
3
3
  class CachedMultiGeocoder
4
4
 
5
- class << self
5
+ class << self
6
6
 
7
7
  def cached_location(location)
8
8
  CachedLocation.find_by_address(location) || CachedLocation.new(:address => location)
data/lib/geokit.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Geokit
2
- VERSION = '1.3.2.4'
2
+ VERSION = '1.3.2.5'
3
3
  # These defaults are used in Geokit::Mappable.distance_to and in acts_as_mappable
4
4
  @@default_units = :miles
5
5
  @@default_formula = :sphere
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Pr0d1r2-geokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2.4
4
+ version: 1.3.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Lewis and Bill Eisenhauer and Pr0d1r2 (Marcin Nowicki)