From d7d9c8aac55b3effbeef2728012f03b4535b7893 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 9 Aug 2010 21:30:56 -0700 Subject: [PATCH] MS put some current users checks into a single one --- app/controllers/application_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8a6ab051e..c36ebc0b3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,10 +16,12 @@ class ApplicationController < ActionController::Base end def set_friends_and_status - @groups = current_user.groups - @friends = current_user.friends if current_user - @latest_status_message = StatusMessage.newest_for(current_user) if current_user - @group = params[:group] ? Group.first(:id => params[:group]) : Group.first + if current_user + @groups = current_user.groups + @friends = current_user.friends + @latest_status_message = StatusMessage.newest_for(current_user) + @group = params[:group] ? Group.first(:id => params[:group]) : Group.first + end end def count_requests