Commit | Line | Data |
---|---|---|
1e70d9dc | 1 | package # hide from PAUSE |
6ebf5cbb | 2 | ViewDeps::Result::Foo; |
3 | ||
4 | use strict; | |
5 | use warnings; | |
ebed3aaf | 6 | use base qw(ViewDeps::Result::Quux); |
6ebf5cbb | 7 | |
ebed3aaf | 8 | __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); |
6ebf5cbb | 9 | __PACKAGE__->table('foo'); |
bf5c3a3f | 10 | |
ebed3aaf | 11 | __PACKAGE__->result_source_instance->view_definition( |
12 | "select * from just_a_table"); | |
bf5c3a3f | 13 | |
6ebf5cbb | 14 | __PACKAGE__->add_columns( |
1e70d9dc | 15 | id => { data_type => 'integer', is_auto_increment => 1 }, |
16 | a => { data_type => 'integer', is_nullable => 1 } | |
6ebf5cbb | 17 | ); |
18 | ||
19 | __PACKAGE__->set_primary_key('id'); | |
20 | ||
1e70d9dc | 21 | __PACKAGE__->belongs_to( 'bar', 'ViewDeps::Result::Bar', |
22 | { 'foreign.id' => 'self.a' } ); | |
6ebf5cbb | 23 | |
24 | 1; |