Commit | Line | Data |
7adfd53f |
1 | package # hide from PAUSE |
2 | RTest::TestDB::Baz; |
3 | |
082e6aee |
4 | use base qw/DBIx::Class::Core/; |
5 | use metaclass 'Reaction::Meta::Class'; |
6 | use Moose; |
7adfd53f |
7 | |
082e6aee |
8 | use MooseX::Types::Moose qw/ArrayRef Int/; |
9 | use Reaction::Types::Core qw/NonEmptySimpleStr/; |
7adfd53f |
10 | |
082e6aee |
11 | has 'id' => (isa => Int, is => 'ro', required => 1); |
ed6d9da8 |
12 | has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1); |
082e6aee |
13 | has 'foo_list' => (isa => ArrayRef, is => 'ro', required => 1); |
7adfd53f |
14 | |
082e6aee |
15 | use namespace::clean -except => [ 'meta' ]; |
7adfd53f |
16 | |
17 | __PACKAGE__->table('baz'); |
18 | |
19 | __PACKAGE__->add_columns( |
20 | id => { data_type => 'integer', size => 16, is_auto_increment => 1 }, |
21 | name => { data_type => 'varchar', size => 255 }, |
22 | ); |
23 | |
7adfd53f |
24 | __PACKAGE__->set_primary_key('id'); |
25 | |
26 | __PACKAGE__->has_many('links_to_foo_list' => 'RTest::TestDB::FooBaz', 'baz'); |
27 | __PACKAGE__->many_to_many('foo_list' => 'links_to_foo_list' => 'foo'); |
28 | |
082e6aee |
29 | sub display_name { shift->name; } |
30 | |
c689b58e |
31 | __PACKAGE__->meta->make_immutable(inline_constructor => 0); |
a5200252 |
32 | |
7adfd53f |
33 | 1; |