From: Tomas Doran Date: Mon, 7 Sep 2009 20:33:31 +0000 (+0000) Subject: Fix duplicate results from get_action_methods. Q. Why didn't I just do that first... X-Git-Tag: 5.80012~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4f4ab5b4e0f1cf9a41e019f52067e968764ee7f4;hp=b138a0d00132d79ae4a1520e7aaeaf894c3bdd57 Fix duplicate results from get_action_methods. Q. Why didn't I just do that first time round? A: Am idiot. --- diff --git a/Changes b/Changes index b91a97f..c268650 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,10 @@ - Fix t/optional_http-server-restart.t test. - Fix duplicate components being loaded at setup time, each component is now loaded at most once + tests. + - Fix backward compatibility - hash key configured actions are stored in + is returned to 'actions'. + - Fix get_action_methods returning duplicate methods when a method is both + decorated with method attributes and set as an action in config. Refactoring / cleanups: - Reduce minimum supported perl version from 5.8.6 to 5.8.4 as there are diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index cb01c11..dc68a33 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -2,7 +2,7 @@ package Catalyst::Controller; use Moose; use Moose::Util qw/find_meta/; - +use List::MoreUtils qw/uniq/; use namespace::clean -except => 'meta'; BEGIN { extends qw/Catalyst::Component MooseX::MethodAttributes::Inheritable/; } @@ -200,7 +200,7 @@ sub get_action_methods { . ( ref $self ) ) } keys %{ $self->_controller_actions } ) if ( ref $self ); - return @methods; + return uniq @methods; }