1 package # hide from PAUSE
6 use base qw/DBIx::Class Reaction::Object/;
8 use Reaction::Types::Core 'NonEmptySimpleStr';
9 use Reaction::Types::DateTime 'DateTime';
10 use Reaction::Types::File 'File';
12 has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
13 has 'foo' => (isa => 'RTest::TestDB::Foo', is => 'rw', required => 1);
14 has 'published_at' => (isa => DateTime, is => 'rw');
15 has 'avatar' => (isa => File, is => 'rw');
17 __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
19 __PACKAGE__->table('bar');
21 __PACKAGE__->add_columns(
22 name => { data_type => 'varchar', size => 255 },
23 foo_id => { data_type => 'integer', size => 16 },
24 published_at => { data_type => 'datetime', is_nullable => 1 },
25 avatar => { data_type => 'blob', is_nullable => 1 },
28 __PACKAGE__->set_primary_key('name');
30 __PACKAGE__->belongs_to(
31 'foo' => 'RTest::TestDB::Foo',
32 { 'foreign.id' => 'self.foo_id' }
35 #__PACKAGE__->meta->make_immutable;
36 __PACKAGE__->meta->make_immutable(inline_constructor => 0);