From 74220b4194fa72cb6787b7ea6ebfcf3fa0aa8f3a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 11 Feb 2013 16:01:04 -0500 Subject: [PATCH] Don't update the current ip to an empty string --- lib/current_user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/current_user.rb b/lib/current_user.rb index 89d47cc4fd1..312288bb106 100644 --- a/lib/current_user.rb +++ b/lib/current_user.rb @@ -21,7 +21,7 @@ module CurrentUser @not_logged_in = session[:current_user_id].blank? if @current_user @current_user.update_last_seen! - if @current_user.ip_address != request.remote_ip + if (@current_user.ip_address != request.remote_ip) and request.remote_ip.present? @current_user.ip_address = request.remote_ip @current_user.update_column(:ip_address, request.remote_ip) end