Permalink
Browse files

dont set 'false' for current_user, and also dont break if id is does …

…not exist
  • Loading branch information...
1 parent 1e8b00a commit c4d9dc2c40f43c71518fea27e779bd592c876905 @mooktakim committed Nov 8, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/extensions/action_controller/base.rb
@@ -32,11 +32,11 @@ def redirect_back_or_default(default)
def current_user
@current_user ||= if session[:user_id]
- User.find(session[:user_id])
+ User.find(session[:user_id]) rescue nil
elsif cookies[:remember_token]
- User.find_by_remember_token(cookies[:remember_token])
+ User.find_by_remember_token(cookies[:remember_token]) rescue nil
else
- false
+ nil
end
end

0 comments on commit c4d9dc2

Please sign in to comment.