lib/geocoder/results/maxmind.rb in geocoder-1.1.6 vs lib/geocoder/results/maxmind.rb in geocoder-1.1.7

- old
+ new

@@ -65,16 +65,15 @@ } end ## # Name of the MaxMind service being used. - # Inferred from format of @data. # def service_name - self.class.field_names.to_a.each do |n,f| - return n if f.size == @data.size - end - nil + # it would be much better to infer this from the length of the @data + # array, but MaxMind seems to send inconsistent and wide-ranging response + # lengths (see https://github.com/alexreisner/geocoder/issues/396) + Geocoder.config.maxmind[:service] end def field_names self.class.field_names[service_name] end