|
|
@ -143,11 +143,16 @@ class FilesController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
|
|
|
|
@containers = [ Project.includes(:attachments).find(@project.id)]
|
|
|
|
@containers += @project.versions.includes(:attachments).reorder(sort).all
|
|
|
|
@containers += @project.versions.includes(:attachments).all
|
|
|
|
|
|
|
|
|
|
|
|
show_attachments @containers
|
|
|
|
ids = []
|
|
|
|
|
|
|
|
@containers.each do |c|
|
|
|
|
|
|
|
|
ids += c.attachments.pluck(:id)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
@containers = [Struct.new(:attachments).new(Attachment.where('id in (?)',ids).reorder(sort))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
show_attachments @containers
|
|
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.html
|
|
|
|