6ee67d58d1fe6cce5d300a28a897fd878b1cc5c8
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Year2000CDs.pm
1 package # hide from PAUSE
2     DBICTest::Schema::Year2000CDs;
3
4 use warnings;
5 use strict;
6
7 use base qw/DBICTest::Schema::CD/;
8
9 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
10 __PACKAGE__->table('year2000cds');
11
12 # need to operate on the instance for things to work
13 __PACKAGE__->result_source_instance->view_definition( sprintf (
14   "SELECT %s FROM cd WHERE year = '2000'",
15   join (', ', __PACKAGE__->columns),
16 ));
17
18 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
19 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track', 'cd' );
20
21 1;