##// END OF EJS Templates
Don't reload attachments if they are already loaded....
Jean-Philippe Lang -
r15731:d521e49dbd3c
parent child
Show More
@@ -34,7 +34,12 module AttachmentsHelper
34 def link_to_attachments(container, options = {})
34 def link_to_attachments(container, options = {})
35 options.assert_valid_keys(:author, :thumbnails)
35 options.assert_valid_keys(:author, :thumbnails)
36
36
37 attachments = container.attachments.preload(:author).to_a
37 attachments = if container.attachments.loaded?
38 container.attachments
39 else
40 container.attachments.preload(:author).to_a
41 end
42
38 if attachments.any?
43 if attachments.any?
39 options = {
44 options = {
40 :editable => container.attachments_editable?,
45 :editable => container.attachments_editable?,
General Comments 0
You need to be logged in to leave comments. Login now