Only check is_virtual on view sources
my(@table_monikers, @view_monikers);
for my $moniker (@monikers){
my $source = $dbicschema->source($moniker);
- next if $source->is_virtual;
if ( $source->isa('DBIx::Class::ResultSource::Table') ) {
push(@table_monikers, $moniker);
} elsif( $source->isa('DBIx::Class::ResultSource::View') ){
+ next if $source->is_virtual;
push(@view_monikers, $moniker);
}
}
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+plan tests => 1;
+
+my $cds_rs = $schema->resultset('CD')->search( { year => 2000 });
+my $year2kcds_rs = $schema->resultset('Year2000CDs');
+
+is($cds_rs->count, $year2kcds_rs->count, 'View Year2000CDs sees all CDs in year 2000');
+
+
+
package # hide from PAUSE
DBICTest::Schema::Year2000CDs;
+## Used in 104view.t
use base 'DBIx::Class::Core';
use DBIx::Class::ResultSource::View;