diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-02 14:49:12 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-02 14:49:12 -0200 |
commit | 1bfc5b4068238bcd82f0ed78351c97fec39e775a (patch) | |
tree | 7ea2fa41783f0b5eb0460f651c2b4d878c5c4a5c | |
parent | e34d856b8db970d7be09b3edbf6bd95150592bd6 (diff) | |
download | rails-1bfc5b4068238bcd82f0ed78351c97fec39e775a.tar.gz rails-1bfc5b4068238bcd82f0ed78351c97fec39e775a.tar.bz2 rails-1bfc5b4068238bcd82f0ed78351c97fec39e775a.zip |
Revert "Merge pull request #7668 from Draiken/fix_issue_6497"
This reverts commit f4ad0ebe7a6b17658bddfeb996e3c34835b75623, reversing
changes made to 8b2cbb3a832101f0e672ee309beca0f8c555b292.
Conflicts:
actionpack/CHANGELOG.md
REASON: This added introduced a bug when you have a shorthand route
inside a nested namespace.
See
https://github.com/rafaelfranca/rails/commit/281367eb770faf8077c1fd6194188e92ed1637a1
-rw-r--r-- | actionpack/CHANGELOG.md | 10 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 7 |
3 files changed, 1 insertions, 18 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 7d7278b59b..0ffae5086e 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -139,16 +139,6 @@ *Tima Maslyuchenko* -* Fixed a bug with shorthand routes scoped with the `:module` option not - adding the module to the controller as described in issue #6497. - This should now work properly: - - scope :module => "engine" do - get "api/version" # routes to engine/api#version - end - - *Luiz Felipe Garcia Pereira* - * Sprockets integration has been extracted from Action Pack to the `sprockets-rails` gem. `rails` gem is depending on `sprockets-rails` by default. diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index c5cf413c8f..3e0bcfb5e8 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -182,7 +182,7 @@ module ActionDispatch controller ||= default_controller action ||= default_action - unless controller.is_a?(Regexp) + unless controller.is_a?(Regexp) || to_shorthand controller = [@scope[:module], controller].compact.join("/").presence end diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 93d89f7568..9c23621968 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -363,7 +363,6 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :errors, :shallow => true do resources :notices end - get 'api/version' end scope :path => 'api' do @@ -1301,12 +1300,6 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'account#shorthand', @response.body end - def test_match_shorthand_with_module - assert_equal '/api/version', api_version_path - get '/api/version' - assert_equal 'api/api#version', @response.body - end - def test_dynamically_generated_helpers_on_collection_do_not_clobber_resources_url_helper assert_equal '/replies', replies_path end |