app/controllers/application_controller.rb
# returns the user that is found by the session id
returns the user that is found by the session id
returns the user that is found by the session id
def current_user
        if session[:user_id] 
            @current_user ||= User.find_by_id(session[:user_id])
        end 
    end
def current_user if session [ :user_id ] @current_user ||= User . find_by_id ( session [ :user_id ] ) end end
returns the user that is found by the session id
returns the user that is found by the session id
# if there is a session_id present (aka someone's logged in)  # find that User object, and save it in the instance variable @current_user # || useful bc then only hit db once if instance vari exists