X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass.pm;h=c12a343385cf249123ce7809f656357a5f94b7e9;hb=140bcb6a5e00a248c375b741579ed09e36604f64;hp=b7f24ee74bd3a417617e48cde991ebc74f00d125;hpb=d63c9e6418251a745cc6b6e1ef5ddf4b12ceb190;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index b7f24ee..c12a343 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -11,49 +11,47 @@ our $VERSION; # $VERSION declaration must stay up here, ahead of any other package # declarations, as to not confuse various modules attempting to determine # this ones version, whether that be s.c.o. or Module::Metadata, etc -$VERSION = '0.082899_01'; +$VERSION = '0.082899_15'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases use DBIx::Class::_Util; use mro 'c3'; -use DBIx::Class::Optional::Dependencies; - use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/; use DBIx::Class::StartupCheck; use DBIx::Class::Exception; __PACKAGE__->mk_group_accessors(inherited => '_skip_namespace_frames'); -__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve'); +__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve|^Moose::Meta::'); # FIXME - this is not really necessary, and is in # fact going to slow things down a bit # However it is the right thing to do in order to get # various install bases to highlight their brokenness # Remove at some unknown point in the future -sub DESTROY { &DBIx::Class::_Util::detected_reinvoked_destructor } - -sub mk_classdata { - shift->mk_classaccessor(@_); -} - -sub mk_classaccessor { - my $self = shift; - $self->mk_group_accessors('inherited', $_[0]); - $self->set_inherited(@_) if @_ > 1; +# +# The oddball BEGIN is there for... reason unknown +# It does make non-segfaulty difference on pre-5.8.5 perls, so shrug +BEGIN { + sub DESTROY { &DBIx::Class::_Util::detected_reinvoked_destructor }; } sub component_base_class { 'DBIx::Class' } sub MODIFY_CODE_ATTRIBUTES { my ($class,$code,@attrs) = @_; - $class->mk_classdata('__attr_cache' => {}) + $class->mk_classaccessor('__attr_cache' => {}) unless $class->can('__attr_cache'); $class->__attr_cache->{$code} = [@attrs]; return (); } +sub FETCH_CODE_ATTRIBUTES { + my ($class,$code) = @_; + @{ $class->_attr_cache->{$code} || [] } +} + sub _attr_cache { my $self = shift; my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {}; @@ -209,7 +207,7 @@ Then you can use these classes in your application's code: my $cd = $millennium_cds_rs->next; # SELECT ... FROM cds JOIN artists ... my $cd_artist_name = $cd->artist->name; # Already has the data so no 2nd query - # new() makes a Result object but doesnt insert it into the DB. + # new() makes a Result object but doesn't insert it into the DB. # create() is the same as new() then insert(). my $new_cd = $schema->resultset('CD')->new({ title => 'Spoon' }); $new_cd->artist($cd->artist); @@ -286,7 +284,7 @@ accessible at the following locations: =item * Travis-CI log: L =for html -↪ Stable branch CI status: +↪ Bleeding edge dev CI status: =back