From a7ab064226608bd8440f0f798b8ade29bdea6fc3 Mon Sep 17 00:00:00 2001
From: Jee Lee <jeehyungl@gmail.com>
Date: Mon, 4 Mar 2013 11:54:30 -0800
Subject: [PATCH] Convert options[:units] to symbol

---
 lib/geocoder/stores/active_record.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/geocoder/stores/active_record.rb b/lib/geocoder/stores/active_record.rb
index 9255a4cb..9cf596dc 100644
--- a/lib/geocoder/stores/active_record.rb
+++ b/lib/geocoder/stores/active_record.rb
@@ -103,6 +103,9 @@ module Geocoder::Store
       # * +:exclude+         - an object to exclude (used by the +nearbys+ method)
       #
       def near_scope_options(latitude, longitude, radius = 20, options = {})
+        if options[:units]
+          options[:units] = options[:units].to_sym
+        end
         options[:units] ||= (geocoder_options[:units] || Geocoder.config.units)
         select_distance = options.fetch(:select_distance, true)
         options[:order] = "" if !select_distance && !options.include?(:order)
-- 
GitLab