Method: Marty::ApplicationController#find_current_user
- Defined in:
- app/controllers/marty/application_controller.rb
#find_current_user ⇒ Object
Returns the current user or nil if no user is logged in
67 68 69 70 71 72 73 74 75 76 |
# File 'app/controllers/marty/application_controller.rb', line 67 def find_current_user user_id = session[:user_id] if user_id user = Marty::User.active.find(user_id) rescue nil else user = try_to_autologin end user end |