From 3385ccd864f58a21d6c82bb148e519a51389bd86 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Mon, 12 Oct 2009 22:01:36 -0400
Subject: [PATCH] Allow geocoder search method to be something other than an
 ActiveRecord attribute.

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

diff --git a/lib/geocoder.rb b/lib/geocoder.rb
index a5f16d42..20dc3068 100644
--- a/lib/geocoder.rb
+++ b/lib/geocoder.rb
@@ -130,10 +130,10 @@ module Geocoder
   
   ##
   # Fetch coordinates based on the object's location.
-  # Returns an array <tt>[lat,lon]</tt>.
+  # Returns an array <tt>[lat,lon]</tt>.search
   #
   def fetch_coordinates
-    location = read_attribute(self.class.geocoder_options[:method_name])
+    location = send(self.class.geocoder_options[:method_name])
     Geocoder.fetch_coordinates(location)
   end
   
-- 
GitLab