Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created June 25, 2012 10:42
Show Gist options
  • Select an option

  • Save nicolasblanco/2987891 to your computer and use it in GitHub Desktop.

Select an option

Save nicolasblanco/2987891 to your computer and use it in GitHub Desktop.
protected
helper_method :current_user
helper_method :decorated_current_user
def current_user
@current_user ||= User.where(:_id => session[:user_id]).first if session[:user_id]
end
def decorated_current_user
UserDecorator.decorate(current_user) if current_user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment