From dc984540a572c90d7708193a24612253a55e6f1d Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Fri, 17 Apr 2009 12:15:37 -0400
Subject: [PATCH] Geocoder#fetch_and_assign_coordinates: explicitly return
 coordinates array or nil.

---
 lib/geocoder.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/geocoder.rb b/lib/geocoder.rb
index bbdb5460..2b9912ad 100644
--- a/lib/geocoder.rb
+++ b/lib/geocoder.rb
@@ -46,13 +46,16 @@ module Geocoder
     if c = fetch_coordinates(attribute)
       self.latitude = c[0]
       self.longitude = c[1]
+      return c
+    else
+      return nil
     end
   end
 
   ##
   # Calculate the distance between two points (Haversine formula). Takes two
   # sets of coordinates and an options hash:
-  #
+  # 
   #   :units : <tt>:mi</tt> for miles (default), <tt>:km</tt> for kilometers
   #
   def self.distance_between(lat1, lon1, lat2, lon2, options = {})
-- 
GitLab