Fixup for count
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class.pm
index 56fe277..f59fc22 100644 (file)
@@ -13,19 +13,22 @@ sub component_base_class { 'DBIx::Class' }
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
 
-$VERSION = '0.05007';
+$VERSION = '0.05999_04';
 
 sub MODIFY_CODE_ATTRIBUTES {
     my ($class,$code,@attrs) = @_;
-    unless ($class->can('_attr_cache')) {
-        $class->mk_classdata('_attr_cache');
-        $class->_attr_cache({});
-    }
-    my $cache = $class->_attr_cache;
-    $class->_attr_cache->{$code} = [@attrs];
+    $class->mk_classdata('__attr_cache' => {}) unless $class->can('__attr_cache');
+    $class->__attr_cache->{$code} = [@attrs];
     return ();
 }
 
+sub _attr_cache {
+    my $self = shift;
+    my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
+    my $rest = eval { $self->next::method };
+    return $@ ? $cache : { %$cache, %$rest };
+}
+
 1;
 
 =head1 NAME 
@@ -122,46 +125,56 @@ Matt S. Trout <mst@shadowcatsystems.co.uk>
 
 =head1 CONTRIBUTORS
 
+Alexander Hartmaier <alex_hartmaier@hotmail.com>
+
 Andy Grundman <andy@hybridized.org>
 
-Brian Cassidy <bricas@cpan.org>
+Andres Kievsky
 
-Dan Kubb <dan.kubb-cpan@onautopilot.com>
+Brandon Black
 
-Dan Sully <daniel@cpan.org>
+Brian Cassidy <bricas@cpan.org>
 
-David Kamholz <dkamholz@cpan.org>
+Christopher H. Laco
 
-Jules Bean
+CL Kao
 
-Marcus Ramberg <mramberg@cpan.org>
+Daisuke Murase <typester@cpan.org>
 
-Paul Makepeace
+Dan Kubb <dan.kubb-cpan@onautopilot.com>
 
-CL Kao
+Dan Sully <daniel@cpan.org>
 
-Jess Robinson
+Daniel Westermann-Clark <danieltwc@cpan.org>
 
-Marcus Ramberg
+David Kamholz <dkamholz@cpan.org>
 
-Will Hawes
+Jesper Krogh
 
-Todd Lipcon
+Jess Robinson
 
-Daniel Westermann-Clark <danieltwc@cpan.org>
+Jules Bean
 
-Alexander Hartmaier <alex_hartmaier@hotmail.com>
+Justin Guenther <guentherj@agr.gc.ca>
 
-Zbigniew Lukasiak
+Marcus Ramberg <mramberg@cpan.org>
 
 Nigel Metheringham <nigelm@cpan.org>
 
-Jesper Krogh
+Paul Makepeace
 
-Brandon Black
+Robert Sedlacek <phaylon@dunkelheit.at>
+
+sc_ of irc.perl.org#dbix-class
+
+Scott McWhirter (konobi)
 
 Scotty Allen <scotty@scottyallen.com>
 
+Todd Lipcon
+
+Will Hawes
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.