Skip to content

Instantly share code, notes, and snippets.

@vkgtaro
Created May 10, 2009 08:42
Show Gist options
  • Save vkgtaro/109553 to your computer and use it in GitHub Desktop.
Save vkgtaro/109553 to your computer and use it in GitHub Desktop.
Index: lib/Catalyst/Controller/Resource.pm
===================================================================
--- lib/Catalyst/Controller/Resource.pm (リビジョン 33201)
+++ lib/Catalyst/Controller/Resource.pm (作業コピー)
@@ -73,7 +73,7 @@
sub _parse_PathPrefix_attr {
my ($self, $c, $name, $value) = @_;
- return PathPart => $self->path_prefix;
+ return PathPart => $self->{path} || $self->path_prefix;
}
sub new {
@@ -110,7 +110,6 @@
my ($self, $map_to, $maps) = @_;
my $class = ref $self || $self;
- my @action_cache = @{ $class->_action_cache };
while (my ($action, $map) = each %$maps) {
next unless my $code = $class->can($action);
$map = { method => uc $map } unless ref($map) eq 'HASH';
@@ -118,20 +117,9 @@
my @attrs = $self->_construct_action_attributes($map_to, $map);
unshift @attrs => @{ attributes::get($code) || [] };
- # rewrite cache
- if (my $cache = first { $code eq $_->[0] } @action_cache) {
- $cache->[1] = [@attrs];
- }
- else {
- push @action_cache => [ $code => [@attrs] ];
- }
- $class->_attr_cache->{$code} = [@attrs];
-
attributes->import($class, $code, @attrs);
}
- # set action_cache
- $class->_action_cache(\@action_cache);
}
sub _collection_attributes { qw/ResourceChained PathPrefix CaptureArgs(0)/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment