diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-19 09:26:37 +0200 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-09-19 19:53:09 +0300 |
commit | 86e7ae82b206b2fd05c886bb1578789554fdb2d1 (patch) | |
tree | 9c1d9f02b8cc9e6350f7a919fe0be6c71f976a89 /config | |
parent | e8dd0d54cb1e82d142978224a4e062a705cae2cf (diff) | |
download | gitlab-ce-86e7ae82b206b2fd05c886bb1578789554fdb2d1.tar.gz |
Use routing concerns to DRY the routes
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/config/routes.rb b/config/routes.rb index 637e5c1bac4..5963e53493b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,6 +35,10 @@ Rails.application.routes.draw do post :approve_access_request, on: :member end + concern :awardable do + post :toggle_award_emoji, on: :member + end + namespace :ci do # CI API Ci::API::API.logger Rails.logger @@ -98,10 +102,9 @@ Rails.application.routes.draw do # # Global snippets # - resources :snippets do + resources :snippets, concerns: :awardable do member do get 'raw' - post :toggle_award_emoji end end @@ -662,7 +665,7 @@ Rails.application.routes.draw do end end - resources :snippets, constraints: { id: /\d+/ } do + resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do member do get 'raw' post :toggle_award_emoji @@ -725,7 +728,7 @@ Rails.application.routes.draw do end end - resources :merge_requests, constraints: { id: /\d+/ } do + resources :merge_requests, concerns: :awardable, constraints: { id: /\d+/ } do member do get :commits get :diffs @@ -737,7 +740,6 @@ Rails.application.routes.draw do post :cancel_merge_when_build_succeeds get :ci_status post :toggle_subscription - post :toggle_award_emoji post :remove_wip get :diff_for_path post :resolve_conflicts @@ -839,10 +841,9 @@ Rails.application.routes.draw do end end - resources :issues, constraints: { id: /\d+/ } do + resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do member do post :toggle_subscription - post :toggle_award_emoji post :mark_as_spam get :referenced_merge_requests get :related_branches @@ -870,9 +871,8 @@ Rails.application.routes.draw do resources :group_links, only: [:index, :create, :destroy], constraints: { id: /\d+/ } - resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do + resources :notes, only: [:index, :create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do member do - post :toggle_award_emoji delete :delete_attachment post :resolve delete :resolve, action: :unresolve |