Skip to content
Browse files

Revert "* lib/journey/formatter.rb: when generating routes, skip route"

This reverts commit 45d4e9e.

Conflicts:

	lib/journey/formatter.rb
  • Loading branch information...
1 parent d278d23 commit a5b1bdc2e15a4144999129b5052f442e60f78fa1 @lifo committed Sep 6, 2012
Showing with 3 additions and 16 deletions.
  1. +0 −10 CHANGELOG.rdoc
  2. +0 −2 lib/journey/formatter.rb
  3. +3 −4 test/test_router.rb
View
10 CHANGELOG.rdoc
@@ -1,13 +1,3 @@
-Thu Jun 14 14:03:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * lib/journey/formatter.rb: when generating routes, skip route
- literals (routes that do not have replacement values like
- "/:controller") when matching unnamed routes.
-
- https://github.com/rails/rails/issues/6459
-
- * test/test_router.rb: corresponding test
-
Wed Feb 15 11:49:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* lib/journey/formatter.rb: reject non-truthy parameters parts.
View
2 lib/journey/formatter.rb
@@ -34,8 +34,6 @@ def generate key, name, options, recall = {}, parameterize = nil
parameterized_parts.keep_if { |_,v| v }
- next if !name && route.requirements.empty? && route.parts.empty?
-
next unless verify_required_parts!(route, parameterized_parts)
z = Hash[options.to_a - data.to_a - route.defaults.to_a]
View
7 test/test_router.rb
@@ -305,12 +305,11 @@ def test_nil_path_parts_are_ignored
end
def test_generate_slash
+ path = Path::Pattern.new '/'
+ @router.routes.add_route nil, path, {}, {}, {}
+
params = [ [:controller, "tasks"],
[:action, "show"] ]
- str = Router::Strexp.new("/", Hash[params], ['/', '.', '?'], true)
- path = Path::Pattern.new str
-
- @router.routes.add_route nil, path, {}, {}, {}
path, _ = @formatter.generate(:path_info, nil, Hash[params], {})
assert_equal '/', path

0 comments on commit a5b1bdc

Please sign in to comment.
Something went wrong with that request. Please try again.