Skip to content

Instantly share code, notes, and snippets.

@bval
Created June 25, 2011 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bval/1045916 to your computer and use it in GitHub Desktop.
Save bval/1045916 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
protect_from_forgery
private
def current_user_session
@current_user_session ||= UserSession.find
end
def current_user
current_user_session && current_user_session.user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment