RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: burtonic
What is the purpose ||= in ruby?
@current_user ||= User.find(session[:user_id]) if session[:user_id]
What is the purpose ||= in ruby?
@current_user ||= User.find(session[:user_id]) if session[:user_id]