全站搜索的结果中不重复显示引用的资源

course_group
z9hang 11 years ago
parent 78ba3abc23
commit 2fdc6ff988

@ -93,7 +93,7 @@ class FilesController < ApplicationController
if sort == "" if sort == ""
sort = "created_on DESC" sort = "created_on DESC"
end end
resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%"). resultSet = Attachment.where("attachments.container_type IS NOT NULL AND attachments.copy_from IS NULL AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort) reorder(sort)
end end

Loading…
Cancel
Save