Commit | Line | Data |
0d9fc72b |
1 | package # hide from PAUSE |
a648ec78 |
2 | DBICTest::Schema::Year2000CDs; |
3 | |
0d9fc72b |
4 | use base qw/DBICTest::Schema::CD/; |
a648ec78 |
5 | |
030c27ad |
6 | __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); |
084a2c0a |
7 | __PACKAGE__->table('year2000cds'); |
a648ec78 |
8 | |
0d9fc72b |
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), |
13 | )); |
a648ec78 |
14 | |
59d89269 |
15 | __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' ); |
18129e81 |
16 | __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track', |
17 | { "foreign.cd" => "self.cdid" }); |
59d89269 |
18 | |
a648ec78 |
19 | 1; |