Skip to content

Commit

Permalink
Remove irrelevant code.
Browse files Browse the repository at this point in the history
Appears to be copied from another lookup. Will not work with :ipgeolocation.
  • Loading branch information
alexreisner committed Jan 7, 2020
1 parent c8b1d48 commit 26a0c96
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/geocoder/lookups/ipgeolocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ def query_url_params(query)
def results(query)
# don't look up a loopback or private address, just return the stored result
return [reserved_result(query.text)] if query.internal_ip_address?
return [] unless doc = fetch_data(query)
if error = doc['error']
code = error['code']
msg = error['info']
raise_error(ERROR_CODES[code], msg ) || Geocoder.log(:warn, "Ipgeolocation Geocoding API error: #{msg}")
return []
end
[doc]
[fetch_data(query)]
end

def reserved_result(ip)
Expand Down

0 comments on commit 26a0c96

Please sign in to comment.