Skip to content

Instantly share code, notes, and snippets.

@dennisreimann
Created June 9, 2010 11:03
Show Gist options
  • Save dennisreimann/431330 to your computer and use it in GitHub Desktop.
Save dennisreimann/431330 to your computer and use it in GitHub Desktop.
module AuthenticationHelpers
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
@current_user = current_user_session && current_user_session.user
end
end
World(AuthenticationHelpers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment