simplify value widgets to reduce PROCESS calls, make some classes immutable which...
[catagits/Reaction.git] / t / lib / RTest / TestDB / Bar.pm
CommitLineData
7adfd53f 1package # hide from PAUSE
2 RTest::TestDB::Bar;
3
4use DBIx::Class 0.07;
5
6use base qw/DBIx::Class Reaction::Object/;
7use Reaction::Class;
8use Reaction::Types::DateTime;
9use Reaction::Types::File;
10
11has 'name' => (isa => 'NonEmptySimpleStr', is => 'rw', required => 1);
12has 'foo' => (isa => 'RTest::TestDB::Foo', is => 'rw', required => 1);
13has 'published_at' => (isa => 'DateTime', is => 'rw');
14has 'avatar' => (isa => 'File', is => 'rw');
15
16__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
17
18__PACKAGE__->table('bar');
19
20__PACKAGE__->add_columns(
21 name => { data_type => 'varchar', size => 255 },
22 foo_id => { data_type => 'integer', size => 16 },
23 published_at => { data_type => 'datetime', is_nullable => 1 },
24 avatar => { data_type => 'blob', is_nullable => 1 },
25);
26
27__PACKAGE__->set_primary_key('name');
28
29__PACKAGE__->belongs_to(
30 'foo' => 'RTest::TestDB::Foo',
31 { 'foreign.id' => 'self.foo_id' }
32);
33
a5200252 34__PACKAGE__->meta->make_immutable;
35
36
7adfd53f 371;