summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-12 18:51:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-12 18:51:34 +0000
commit887b8d2fdf0604c6fac624b3e3d8ca43dd525346 (patch)
treee921ea2e0ac5651745a84f2c58056a6e47888f57 /app/controllers
parent039580b73df1d8f4f5471ee97dd0e207c193ae1f (diff)
downloadredmine-887b8d2fdf0604c6fac624b3e3d8ca43dd525346.tar.gz
redmine-887b8d2fdf0604c6fac624b3e3d8ca43dd525346.zip
Adds a link to container on attachments edit form.
git-svn-id: http://svn.redmine.org/redmine/trunk@17722 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/attachments_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 9c0bf15ba..552ff9cff 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -164,8 +164,10 @@ class AttachmentsController < ApplicationController
# Returns the menu item that should be selected when viewing an attachment
def current_menu_item
- if @attachment
- case @attachment.container
+ container = @attachment.try(:container) || @container
+
+ if container
+ case container
when WikiPage
:wiki
when Message
@@ -173,7 +175,7 @@ class AttachmentsController < ApplicationController
when Project, Version
:files
else
- @attachment.container.class.name.pluralize.downcase.to_sym
+ container.class.name.pluralize.downcase.to_sym
end
end
end