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