1 package # hide from PAUSE
2 DBICTest::Schema::Year2000CDs;
4 use base qw/DBICTest::Schema::CD/;
6 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
7 __PACKAGE__->table('year2000cds');
9 # need to operate on the instance for things to work
10 __PACKAGE__->result_source_instance->view_definition( sprintf (
11 'SELECT %s FROM cd WHERE year = "2000"',
12 join (', ', __PACKAGE__->columns),
15 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
16 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
17 { "foreign.cd" => "self.cdid" });