数据库误删除的问题
This commit is contained in:
parent
7eb5317696
commit
48172599cc
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue