From: Peter Rabbitson Date: Sun, 15 May 2016 13:54:30 +0000 (+0200) Subject: Streamline ::ResultSource::* inheritance, similar to d009cb7d X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f068248010455f821c215bf029517cb99aac3e5;p=dbsrgits%2FDBIx-Class-Historic.git Streamline ::ResultSource::* inheritance, similar to d009cb7d There should be zero functional changes --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 14e07d3..6fa12c3 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -3,10 +3,8 @@ package DBIx::Class::ResultSource; use strict; use warnings; -use base 'DBIx::Class'; -__PACKAGE__->load_components(qw( - ResultSource::RowParser -)); +use base 'DBIx::Class::ResultSource::RowParser'; +use mro 'c3'; use DBIx::Class::Carp; use DBIx::Class::_Util qw( UNRESOLVABLE_CONDITION dbic_internal_try fail_on_internal_call ); @@ -14,6 +12,9 @@ use SQL::Abstract 'is_literal_value'; use Devel::GlobalDestruction; use Scalar::Util qw/blessed weaken isweak/; +# FIXME - somehow breaks ResultSetManager, do not remove until investigated +use DBIx::Class::ResultSet; + use namespace::clean; __PACKAGE__->mk_group_accessors(simple => qw/ diff --git a/lib/DBIx/Class/ResultSource/RowParser.pm b/lib/DBIx/Class/ResultSource/RowParser.pm index 9d41e01..efd67b1 100644 --- a/lib/DBIx/Class/ResultSource/RowParser.pm +++ b/lib/DBIx/Class/ResultSource/RowParser.pm @@ -5,6 +5,7 @@ use strict; use warnings; use base 'DBIx::Class'; +use mro 'c3'; use Try::Tiny; use List::Util 'max'; diff --git a/lib/DBIx/Class/ResultSource/Table.pm b/lib/DBIx/Class/ResultSource/Table.pm index f1900f9..e1dcc03 100644 --- a/lib/DBIx/Class/ResultSource/Table.pm +++ b/lib/DBIx/Class/ResultSource/Table.pm @@ -3,10 +3,8 @@ package DBIx::Class::ResultSource::Table; use strict; use warnings; -use DBIx::Class::ResultSet; - -use base qw/DBIx::Class/; -__PACKAGE__->load_components(qw/ResultSource/); +use base 'DBIx::Class::ResultSource'; +use mro 'c3'; =head1 NAME diff --git a/lib/DBIx/Class/ResultSource/View.pm b/lib/DBIx/Class/ResultSource/View.pm index 846bcf6..5995790 100644 --- a/lib/DBIx/Class/ResultSource/View.pm +++ b/lib/DBIx/Class/ResultSource/View.pm @@ -3,10 +3,9 @@ package DBIx::Class::ResultSource::View; use strict; use warnings; -use DBIx::Class::ResultSet; +use base 'DBIx::Class::ResultSource'; +use mro 'c3'; -use base qw/DBIx::Class/; -__PACKAGE__->load_components(qw/ResultSource/); __PACKAGE__->mk_group_accessors( 'simple' => qw(is_virtual view_definition deploy_depends_on) ); diff --git a/xt/extra/c3_mro.t b/xt/extra/c3_mro.t index 27a0341..db60402 100644 --- a/xt/extra/c3_mro.t +++ b/xt/extra/c3_mro.t @@ -59,6 +59,10 @@ check_ancestry($_) for ( ref( $art->result_source ), ref( $art->result_source->resultset ), ref( $art->result_source->schema ), + ( map + { ref $art->result_source->schema->source($_) } + $art->result_source->schema->sources + ), qw( AAA BBB CCC ), ((! DBIx::Class::Optional::Dependencies->req_ok_for('cdbicompat') ) ? () : do { unshift @INC, 't/cdbi/testlib';