Skip to content
Snippets Groups Projects
Commit 60b6ea45 authored by Alex Reisner's avatar Alex Reisner
Browse files

Simplify code and don't warn.

parent 2c63b645
No related branches found
No related tags found
No related merge requests found
......@@ -10,16 +10,7 @@ module Geocoder::Lookup
def results(query, reverse = false)
return [] unless doc = fetch_data(query, reverse)
if doc.kind_of?(Array)
if doc.any?
return doc[0]['place_id'] != "" ? doc : []
else
warn "Address not found or Nominatim Geocoding API error."
return []
end
else
return doc['place_id'] != "" ? doc = [] << doc : []
end
doc.is_a?(Array) ? doc : [doc]
end
def query_url(query, reverse = false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment