add which_action_and_user to application_controller

This commit is contained in:
danielvincent 2011-01-28 16:15:30 -08:00
parent 2dfb9f9618
commit ae8686ef25
3 changed files with 13 additions and 0 deletions

View file

@ -10,6 +10,7 @@ class ApplicationController < ActionController::Base
before_filter :count_requests
before_filter :set_invites
before_filter :set_locale
before_filter :which_action_and_user
def set_contacts_notifications_and_status
if user_signed_in?
@ -30,6 +31,16 @@ class ApplicationController < ActionController::Base
end
end
def which_action_and_user
str = "controller=#{self.class} action=#{self.action_name} "
if current_user
str << "uid=#{current_user.id}"
else
str << 'uid=nil'
end
Rails.logger.info str
end
def set_locale
if user_signed_in?
I18n.locale = current_user.language

View file

@ -7,6 +7,7 @@ class PostsController < ApplicationController
skip_before_filter :count_requests
skip_before_filter :set_invites
skip_before_filter :set_locale
skip_before_filter :which_action_and_user
def show
@post = Post.where(:id => params[:id], :public => true).includes(:person, :comments => :person).first

View file

@ -10,6 +10,7 @@ class PublicsController < ApplicationController
skip_before_filter :count_requests
skip_before_filter :set_invites
skip_before_filter :set_locale
skip_before_filter :which_action_and_user
layout false
caches_page :host_meta