summaryrefslogtreecommitdiffstats
path: root/app/helpers/attachments_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-24 09:07:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-24 09:07:33 +0000
commite04c819895cd31cb6639992e4dbe3296a19ac079 (patch)
tree85208362ee0dc299a0cd492ae07c6441a85c0efb /app/helpers/attachments_helper.rb
parent9d3f3289b887a25f6d84bbb84afedad831e41be6 (diff)
downloadredmine-e04c819895cd31cb6639992e4dbe3296a19ac079.tar.gz
redmine-e04c819895cd31cb6639992e4dbe3296a19ac079.zip
Don't check if attachments are editable individually.
git-svn-id: http://svn.redmine.org/redmine/trunk@13935 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/attachments_helper.rb')
-rw-r--r--app/helpers/attachments_helper.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
index bc3ba518d..f7f9007b5 100644
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -34,12 +34,17 @@ module AttachmentsHelper
def link_to_attachments(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
- if container.attachments.any?
- options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
+ attachments = container.attachments.preload(:author).to_a
+ if attachments.any?
+ options = {
+ :editable => container.attachments_editable?,
+ :deletable => container.attachments_deletable?,
+ :author => true
+ }.merge(options)
render :partial => 'attachments/links',
:locals => {
:container => container,
- :attachments => container.attachments,
+ :attachments => attachments,
:options => options,
:thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)
}