Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed bug in do_lookup

  • Loading branch information...
commit 7997e4e0926a07d0adf001026d8d8c330a06499f 1 parent 42b0edd
@DaveSanders authored
View
13 lib/geocoder/models/base.rb
@@ -28,15 +28,16 @@ def reverse_geocoded_by
private # ----------------------------------------------------------------
- def geocoder_init(options)
- unless @geocoder_options
- @geocoder_options = {}
+ def geocoder_init(options)
+ #unless @geocoder_options
+ @geocoder_options = @geocoder_options || {}
@geocoder_options.merge! options
require "geocoder/stores/#{geocoder_file_name}"
include Geocoder::Store.const_get(geocoder_module_name)
- else
- @geocoder_options.merge! options
- end
+
+ #else
+ # @geocoder_options.merge! options
+ #end
end
end
end
View
3  lib/geocoder/stores/active_record.rb
@@ -243,7 +243,8 @@ def full_column_name(column)
# (or other as specified in +geocoded_by+). Returns coordinates (array).
#
def geocode
- geocoder_options[:prefixes].each do |pre|
+
+ self.class.geocoder_options[:prefixes].each do |pre|
p = pre.empty? ? pre : "#{pre}_"
a = "#{p}#{self.class.geocoder_options[:address].to_s}"
address = self.send(a) if self.respond_to? a
View
2  lib/geocoder/stores/base.rb
@@ -96,7 +96,7 @@ def do_lookup(reverse = false, address=nil)
if reverse and options[:reverse_geocode]
query = to_coordinates
elsif !reverse and options[:geocode]
- query = send(address)
+ query = address
else
return
end
Please sign in to comment.
Something went wrong with that request. Please try again.