Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Forked from tcrayford/gist:1591542
Created January 10, 2012 22:17
Show Gist options
  • Save garybernhardt/1591551 to your computer and use it in GitHub Desktop.
Save garybernhardt/1591551 to your computer and use it in GitHub Desktop.
# Hash form:
{
:current_user => "CurrentUser.current_user"
}
# Discovery form with inverted app structure:
module Injectables
def current_user(session)
User.find(:id => session['current_user_id'])
end
end
# A whole class seems like overkill. Then again, we've talked about
# injectables without fixed names. That's scary, though, because we
# can't ensure no clashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment