Skip to content

Instantly share code, notes, and snippets.

@dachinat
Created November 17, 2017 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dachinat/413b1cc494b0c8723b5814cab71b7c98 to your computer and use it in GitHub Desktop.
Save dachinat/413b1cc494b0c8723b5814cab71b7c98 to your computer and use it in GitHub Desktop.
Test geocoder when ip is 127.0.0.1
# config/geocoder.rb
module Geocoder
module Request
def location
@location ||= begin
Geocoder.search(IpAddress.new('190.12.48.158')).first
end
@location
end
end
end
# request.location now should return results with hardcoded ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment