diff options
Diffstat (limited to 'app/helpers/attachments_helper.rb')
-rw-r--r-- | app/helpers/attachments_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index 217382476..f7098322b 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -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?, |