Commit ea823397 authored by jplang's avatar jplang
Browse files

Don't reload attachments if they are already loaded.

git-svn-id: https://svn.redmine.org/redmine/trunk@16113 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f7806aa7
......@@ -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?,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment