diff options
-rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 2 | ||||
-rw-r--r-- | guides/source/api_documentation_guidelines.md | 2 | ||||
-rw-r--r-- | railties/CHANGELOG.md | 4 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 5 | ||||
-rw-r--r-- | railties/test/application/routing_test.rb | 19 |
5 files changed, 29 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index 086c678af5..99fdef67d0 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -131,7 +131,7 @@ module ActiveRecord def remove_connection(name = nil) name ||= @connection_specification_name if defined?(@connection_specification_name) - # if removing a connection that have a pool, we reset the + # if removing a connection that has a pool, we reset the # connection_specification_name so it will use the parent # pool. if connection_handler.retrieve_connection_pool(name) diff --git a/guides/source/api_documentation_guidelines.md b/guides/source/api_documentation_guidelines.md index 5b34330936..34b9c0d2ca 100644 --- a/guides/source/api_documentation_guidelines.md +++ b/guides/source/api_documentation_guidelines.md @@ -20,7 +20,7 @@ The [Rails API documentation](http://api.rubyonrails.org) is generated with in the rails root directory, run `bundle install` and execute: ```bash - ./bin/rails rdoc + bundle exec rake rdoc ``` Resulting HTML files can be found in the ./doc/rdoc directory. diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index b8f1cda329..982385438b 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Ensure `/rails/info` routes match in development for apps with a catch-all globbing route. + + *Nicholas Firth-McCoy* + * Added a shared section to `config/secrets.yml` that will be loaded for all environments. *DHH* diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 4e24640510..97dde9a3e9 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -21,10 +21,13 @@ module Rails initializer :add_builtin_route do |app| if Rails.env.development? - app.routes.append do + app.routes.prepend do get '/rails/info/properties' => "rails/info#properties", internal: true get '/rails/info/routes' => "rails/info#routes", internal: true get '/rails/info' => "rails/info#index", internal: true + end + + app.routes.append do get '/' => "rails/welcome#index", internal: true end end diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index e51f32aaed..93847c7aa9 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -39,6 +39,25 @@ module ApplicationTests assert_equal 200, last_response.status end + test "/rails/info routes are accessible with globbing route present" do + app("development") + + app_file "config/routes.rb", <<-RUBY + Rails.application.routes.draw do + get '*foo', to: 'foo#index' + end + RUBY + + get "/rails/info" + assert_equal 302, last_response.status + + get "rails/info/routes" + assert_equal 200, last_response.status + + get "rails/info/properties" + assert_equal 200, last_response.status + end + test "root takes precedence over internal welcome controller" do app("development") |