Skip to content

Instantly share code, notes, and snippets.

@ChangJoo-Park
Created January 14, 2013 17:58
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 ChangJoo-Park/4531933 to your computer and use it in GitHub Desktop.
Save ChangJoo-Park/4531933 to your computer and use it in GitHub Desktop.
||= 를 사용하면 동일한 내용이 있는 경우 다시 쿼리를 하지 않음
def current_user
@current_user ||= User.find(session[:user_id])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment