Remove <=> overloading for actions.
Florian Ragwitz [Mon, 29 Jun 2009 22:05:02 +0000 (22:05 +0000)]
lib/Catalyst/Action.pm
lib/Catalyst/DispatchType/Path.pm

index 1649f35..cd2d008 100644 (file)
@@ -37,9 +37,6 @@ use overload (
     # Codulate to execute to invoke the encapsulated action coderef
     '&{}' => sub { my $self = shift; sub { $self->execute(@_); }; },
 
-    # Which action takes precedence
-    '<=>' => 'compare',
-
     # Make general $stuff still work
     fallback => 1,
 
@@ -124,8 +121,6 @@ Always returns true if Args is omitted.
 Compares 2 actions based on the value of the C<Args> attribute, with no C<Args>
 having the highest precedence.
 
-C<< <=> >> is overloaded to use this method.
-
 =head2 namespace
 
 Returns the private namespace this action lives in.
index bff5f21..95367ac 100644 (file)
@@ -119,7 +119,7 @@ sub register_path {
     $path =~ s{(?<=[^/])/+\z}{};
 
     $self->_paths->{$path} = [
-        sort { $a <=> $b } ($action, @{ $self->_paths->{$path} || [] })
+        sort { $a->compare($b) } ($action, @{ $self->_paths->{$path} || [] })
     ];
 
     return 1;