Deal with param passing master
Tomas Doran [Mon, 26 Dec 2011 23:24:34 +0000 (23:24 +0000)]
lib/CatalystX/UriFor/Curried.pm

index e8e5db5..006f7c6 100644 (file)
@@ -25,12 +25,13 @@ role {
         my ($ctx, $action_or_private_path, $captures, @args)  = @_;
         my $weak_ctx = $ctx; # Just for safety so it can't be closed over.
         weaken($weak_ctx);
+        my $params = ref($args[-1]) eq 'HASH' ? pop(@args) : {};
         if (ref($captures) eq 'ARRAY' || (!$captures && !scalar(@args))) { # FIXME BUG IN THIS LOGIC
             $captures ||= [];
             foreach my $name_or_sub ($stash_captures->flatten) {
                 unshift(@$captures, ref($name_or_sub) eq 'CODE' ? $name_or_sub->($weak_ctx) : $ctx->stash->{$name_or_sub});
             }
-            $ctx->uri_for_action($action_or_private_path, $captures, @args);
+            $ctx->uri_for_action($action_or_private_path, $captures, @args, $params);
         }
     };