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