Created
November 17, 2017 20:04
-
-
Save dachinat/413b1cc494b0c8723b5814cab71b7c98 to your computer and use it in GitHub Desktop.
Test geocoder when ip is 127.0.0.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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