From bdd1980876e9d672ab37677d305d0307ca08f964 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 10 Mar 2015 11:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E9=A6=96=E9=A1=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e6171bf81..d770a4633 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -446,12 +446,13 @@ class UsersController < ApplicationController activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc') end activity = activity.reject { |e| - !User.current.admin? && + e.act.nil? || + (!User.current.admin? && !e.act.nil? (((e.act_type == "Issue") && !e.act.project.visible?(User.current)) || (e.act_type == "Bid" && !e.act.courses.first.nil? && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || (e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) || (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) || - (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))) + (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course)))))) } @activity_count = activity.count @activity_pages = Paginator.new @activity_count, pre_count, params['page']