1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-03 14:19:41 +00:00

Don't reload attachments if they are already loaded.

git-svn-id: http://svn.redmine.org/redmine/trunk@16113 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-12-31 12:35:15 +00:00
parent e8cffd614e
commit d521e49dbd

View File

@ -34,7 +34,12 @@ module AttachmentsHelper
def link_to_attachments(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
attachments = container.attachments.preload(:author).to_a
attachments = if container.attachments.loaded?
container.attachments
else
container.attachments.preload(:author).to_a
end
if attachments.any?
options = {
:editable => container.attachments_editable?,