From ce67e84a6046dfe4e62b0a6eb143b175030df8f4 Mon Sep 17 00:00:00 2001 From: Micha Wrobel Date: Sun, 26 Feb 2012 17:57:46 +0100 Subject: [PATCH] Don't raise AR::RecordNotFound if there is no id --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fcd8e8e..14013a0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base private def current_user - @current_user ||= User.find(session[:user_id]) if session[:user_id] + @current_user ||= User.first(:id => session[:user_id]) if session[:user_id] end def current_user=(user)