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
=head1 CONTRIBUTORS
-Andy Grundman <andy@hybridized.org>
-
-Brian Cassidy <bricas@cpan.org>
-
-Dan Kubb <dan.kubb-cpan@onautopilot.com>
+Alexander Hartmaier <alex_hartmaier@hotmail.com>
-Dan Sully <daniel@cpan.org>
+Andy Grundman <andy@hybridized.org>
-David Kamholz <dkamholz@cpan.org>
+Andres Kievsky
-Jules Bean
+Brandon Black
-Marcus Ramberg <mramberg@cpan.org>
+Brian Cassidy <bricas@cpan.org>
-Paul Makepeace
+Christopher H. Laco
CL Kao
-Jess Robinson
-
-Marcus Ramberg
+Daisuke Murase <typester@cpan.org>
-Will Hawes
+Dan Kubb <dan.kubb-cpan@onautopilot.com>
-Todd Lipcon
+Dan Sully <daniel@cpan.org>
Daniel Westermann-Clark <danieltwc@cpan.org>
-Alexander Hartmaier <alex_hartmaier@hotmail.com>
+David Kamholz <dkamholz@cpan.org>
-Zbigniew Lukasiak
+Jesper Krogh
-Nigel Metheringham <nigelm@cpan.org>
+Jess Robinson
-Jesper Krogh
+Jules Bean
-Brandon Black
+Justin Guenther <guentherj@agr.gc.ca>
-Christopher H. Laco
+Marcus Ramberg <mramberg@cpan.org>
-Scotty Allen <scotty@scottyallen.com>
+Nigel Metheringham <nigelm@cpan.org>
-sc_
+Paul Makepeace
Robert Sedlacek <phaylon@dunkelheit.at>
-Justin Guenther <jguenther@agr.gc.ca>
-
-Daisuke Murase <typester@cpan.org>
+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.