summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-11-22 08:42:44 +0000
committerGo MAEDA <maeda@farend.jp>2021-11-22 08:42:44 +0000
commit0a5ef25e87f7896a70bfd86302e6e8995b518f98 (patch)
tree95264ef633eb0c0505c46bbfe68f886dd7d4e5a3 /app/controllers
parentd72ae9b32b7bef20eb1f2f291d54f3ad4297994e (diff)
downloadredmine-0a5ef25e87f7896a70bfd86302e6e8995b518f98.tar.gz
redmine-0a5ef25e87f7896a70bfd86302e6e8995b518f98.zip
Download all attachments in a journal (#35462).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@21292 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/attachments_controller.rb2
-rw-r--r--app/controllers/journals_controller.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 91cd7ce41..05561f015 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -225,7 +225,7 @@ class AttachmentsController < ApplicationController
rescue
nil
end
- unless klass && klass.reflect_on_association(:attachments)
+ unless klass && (klass.reflect_on_association(:attachments) || klass.method_defined?(:attachments))
render_404
return
end
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index 95f47e360..c2674a4c4 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -28,6 +28,7 @@ class JournalsController < ApplicationController
helper :issues
helper :custom_fields
helper :queries
+ helper :attachments
include QueriesHelper
def index