This repository has been archived by the owner on Sep 13, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lib/journey/formatter.rb: when generating routes, skip route
literals (routes that do not have replacement values like "/:controller") when matching unnamed routes. rails/rails#6459 * test/test_router.rb: corresponding test Conflicts: lib/journey/formatter.rb
- Loading branch information
1 parent
361af48
commit c70e548
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ def generate key, name, options, recall = {}, parameterize = nil | |
|
||
parameterized_parts.keep_if { |_,v| v } | ||
|
||
next if !name && route.requirements.empty? && route.parts.empty? | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pixeltrix
|
||
|
||
next unless verify_required_parts!(route, parameterized_parts) | ||
|
||
z = Hash[options.to_a - data.to_a - route.defaults.to_a] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shouldn't that be
route.path.requirements.empty?
otherwise it'll never be empty since it will include the defaults like:controller
and:action
merged in.