diff options
author | Go MAEDA <maeda@farend.jp> | 2022-10-20 04:13:21 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-10-20 04:13:21 +0000 |
commit | aeabd4682a3ff98a6e7d6b5ed0c7091937964033 (patch) | |
tree | ca8a82184f2df557553c81967b9d112e920bd1f5 /config/routes.rb | |
parent | d726df660f726171d6f42bb30fd163dfbb1fd230 (diff) | |
download | redmine-aeabd4682a3ff98a6e7d6b5ed0c7091937964033.tar.gz redmine-aeabd4682a3ff98a6e7d6b5ed0c7091937964033.zip |
Constraints *_all attachments routes to actually supported values of container_type (#37772).
Patch by Jens Krämer.
git-svn-id: https://svn.redmine.org/redmine/trunk@21906 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/config/routes.rb b/config/routes.rb index fa65b4417..2a8e24c0a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -317,9 +317,11 @@ Rails.application.routes.draw do get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/ get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail' resources :attachments, :only => [:show, :update, :destroy] - get 'attachments/:object_type/:object_id/edit', :to => 'attachments#edit_all', :as => :object_attachments_edit - patch 'attachments/:object_type/:object_id', :to => 'attachments#update_all', :as => :object_attachments - get 'attachments/:object_type/:object_id/download', :to => 'attachments#download_all', :as => :object_attachments_download + constraints object_type: /(issues|versions|news|messages|wiki_pages|projects|documents|journals)/ do + get 'attachments/:object_type/:object_id/edit', :to => 'attachments#edit_all', :as => :object_attachments_edit + patch 'attachments/:object_type/:object_id', :to => 'attachments#update_all', :as => :object_attachments + get 'attachments/:object_type/:object_id/download', :to => 'attachments#download_all', :as => :object_attachments_download + end resources :groups do resources :memberships, :controller => 'principal_memberships' |