From 48172599cc721c2889c9bf5fb1285f5f2abdf0de Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 17 Jan 2014 10:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AF=AF=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/stores_controller.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index 6e7bbdc93..84a9c95d6 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -13,19 +13,19 @@ class StoresController < ApplicationController result = resultSet.to_a.dup - # result.map { |res| - # if(res.container.nil? || - # (res.container.class.to_s=="Project" && res.container.is_public == false) || - # (res.container.has_attribute?(:project) && res.container.project.is_public == false) || - # (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) || - # false - # ) - # logger.debug("=====================================#{result.include? res}") - # logger.debug("=====================================#{res}") - # result.delete(res) - # logger.debug("=====================================#{result.include? res}") - # end - # } + result.map { |res| + if(res.container.nil? || + (res.container.class.to_s=="Project" && res.container.is_public == false) || + (res.container.has_attribute?(:project) && res.container.project.is_public == false) || + (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) || + false + ) + # logger.debug("=====================================#{result.include? res}") + # logger.debug("=====================================#{res}") + result.delete(res) + # logger.debug("=====================================#{result.include? res}") + end + } @searched_attach = paginateHelper result end