Skip to content
Browse files

fixed a url_for bug where route captures would be ignored

  • Loading branch information...
1 parent 066affb commit 20ebf7e3ac96fc124e866a78874dba1930fbedcc @kraih kraih committed Aug 20, 2011
Showing with 6 additions and 6 deletions.
  1. +3 −0 Changes
  2. +1 −1 lib/Mojolicious.pm
  3. +0 −3 lib/Mojolicious/Routes/Match.pm
  4. +2 −2 t/mojolicious/routes.t
View
3 Changes
@@ -1,5 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.
+1.85 2011-08-20 00:00:00
+ - Fixed a url_for bug where captures would be ignored.
+
1.84 2011-08-19 00:00:00
- Added EXPERIMENTAL first, reverse, shuffle and sort methods to
Mojo::Collection.
View
2 lib/Mojolicious.pm
@@ -34,7 +34,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };
our $CODENAME = 'Smiling Face With Sunglasses';
-our $VERSION = '1.84';
+our $VERSION = '1.85';
# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
View
3 lib/Mojolicious/Routes/Match.pm
@@ -169,9 +169,6 @@ sub path_for {
# Find endpoint
else {
- $captures = {};
-
- # Find
my @children = ($self->root);
my $candidate;
while (my $child = shift @children) {
View
4 t/mojolicious/routes.t
@@ -304,9 +304,9 @@ is $m->stack->[1]->{action}, 'edit', 'right value';
is $m->stack->[1]->{format}, 'html', 'right value';
is $m->path_for, '/articles/1/edit', 'right path';
is $m->path_for(format => 'html'), '/articles/1/edit.html', 'right path';
-is $m->path_for('articles_delete', format => undef), '/articles/delete',
+is $m->path_for('articles_delete', format => undef), '/articles/1/delete',
'right path';
-is $m->path_for('articles_delete'), '/articles/delete', 'right path';
+is $m->path_for('articles_delete'), '/articles/1/delete', 'right path';
is $m->path_for('articles_delete', id => 12), '/articles/12/delete',
'right path';
is @{$m->stack}, 2, 'right number of elements';

0 comments on commit 20ebf7e

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