From 052690941bc85a279cb637ff0075ce0a46f86028 Mon Sep 17 00:00:00 2001 From: Steven Fuchs Date: Sun, 22 Jan 2012 23:23:21 -0500 Subject: [PATCH] move set_header_data back into application_controller --- app/controllers/application_controller.rb | 7 +++++++ app/helpers/application_helper.rb | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6639409e0..726d7f3d6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,6 +24,13 @@ class ApplicationController < ActionController::Base :tags, :open_publisher + def set_header_data + if user_signed_in? && request.format.html? && !params[:only_posts] + @notification_count = Notification.for(current_user, :unread =>true).count + @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}") + end + end + def ensure_http_referer_is_set request.env['HTTP_REFERER'] ||= '/aspects' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9601b2c98..a32d76a4b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,13 +4,6 @@ module ApplicationHelper - def set_header_data - if user_signed_in? && request.format.html? && !params[:only_posts] - @notification_count = Notification.for(current_user, :unread =>true).count - @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}") - end - end - def how_long_ago(obj) timeago(obj.created_at) end