diff options
| author | mo <mokha@cisco.com> | 2017-07-27 17:28:42 -0600 |
|---|---|---|
| committer | mo <mokha@cisco.com> | 2017-07-27 17:28:42 -0600 |
| commit | eb245e2f0bf2e5f29699fb9399fd57f8a1bcfc51 (patch) | |
| tree | e8d3ce282b37ebe693e6cd72fb989f2da31510e3 /app | |
| parent | 6f0d2897d5aaf028fc17854b7cbff01e0ae2abf0 (diff) | |
return nil if location lookup fails.
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/location.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/location.rb b/app/models/location.rb index 97c43e6..2587909 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -26,6 +26,7 @@ class Location < ApplicationRecord class << self def build_from_ip(ip) result = search(ip) + return nil if result.nil? new( address: result.address, city: result.city, |
