app/jobs/auth_trail/geocode_job.rb in authtrail-0.3.1 vs app/jobs/auth_trail/geocode_job.rb in authtrail-0.4.0

- old
+ new

@@ -6,19 +6,23 @@ def perform(login_activity) result = begin Geocoder.search(login_activity.ip).first + rescue NameError + # geocoder gem not installed + raise rescue => e Rails.logger.info "Geocode failed: #{e.message}" nil end if result attributes = { city: result.try(:city), region: result.try(:state), country: result.try(:country), + country_code: result.try(:country_code), latitude: result.try(:latitude), longitude: result.try(:longitude) } attributes.each do |k, v| login_activity.try("#{k}=", v.presence)