diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-07-20 00:20:41 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-07-20 00:20:41 +0200 |
commit | 8ead4b22e1df0883d1780255845ba0ae0a9651e1 (patch) | |
tree | 2cc61ad25df9d60fdf2c005e736f689210a32c33 /config | |
parent | 4a74798a7ba16fec37f634d0eaf52b838213e090 (diff) | |
parent | b9ed9d658ad447a64d58b2040849a7cc0e698287 (diff) | |
download | gitlab-ce-8ead4b22e1df0883d1780255845ba0ae0a9651e1.tar.gz |
Merge remote-tracking branch 'origin/master' into 15343-build-settiings
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/relative_naming_ci_namespace.rb | 16 | ||||
-rw-r--r-- | config/routes.rb | 10 |
2 files changed, 21 insertions, 5 deletions
diff --git a/config/initializers/relative_naming_ci_namespace.rb b/config/initializers/relative_naming_ci_namespace.rb new file mode 100644 index 00000000000..59abe1b9b91 --- /dev/null +++ b/config/initializers/relative_naming_ci_namespace.rb @@ -0,0 +1,16 @@ +# Description: https://coderwall.com/p/heed_q/rails-routing-and-namespaced-models +# +# This allows us to use CI ActiveRecord objects in all routes and use it: +# - [project.namespace, project, build] +# +# instead of: +# - namespace_project_build_path(project.namespace, project, build) +# +# Without that, Ci:: namespace is used for resolving routes: +# - namespace_project_ci_build_path(project.namespace, project, build) + +module Ci + def self.use_relative_model_naming? + true + end +end diff --git a/config/routes.rb b/config/routes.rb index 70cbc99d614..29ceb1e23e9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,11 +89,10 @@ Rails.application.routes.draw do mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put] # Help - - get 'help' => 'help#index' - get 'help/*path' => 'help#show', as: :help_page - get 'help/shortcuts' - get 'help/ui' => 'help#ui' + get 'help' => 'help#index' + get 'help/shortcuts' => 'help#shortcuts' + get 'help/ui' => 'help#ui' + get 'help/*path' => 'help#show', as: :help_page # # Global snippets @@ -755,6 +754,7 @@ Rails.application.routes.draw do get :status post :cancel post :retry + post :play post :erase get :trace get :raw |