package # hide from PAUSE
RTest::TestDB::Bar;
-use DBIx::Class 0.07;
+use base qw/DBIx::Class/;
+use metaclass 'Reaction::Meta::Class';
+use Moose;
-use base qw/DBIx::Class Reaction::Object/;
-use Reaction::Class;
-use Reaction::Types::Core 'NonEmptySimpleStr';
-use Reaction::Types::DateTime 'DateTime';
+use Reaction::Types::Core qw/NonEmptySimpleStr/;
+use Reaction::Types::DateTime qw//;
use Reaction::Types::File 'File';
has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
has 'foo' => (isa => 'RTest::TestDB::Foo', is => 'rw', required => 1);
-has 'published_at' => (isa => DateTime, is => 'rw');
+has 'published_at' => (isa => Reaction::Types::DateTime::DateTime, is => 'rw');
has 'avatar' => (isa => File, is => 'rw');
+use namespace::clean -except => [ 'meta' ];
+
__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
__PACKAGE__->table('bar');
{ 'foreign.id' => 'self.foo_id' }
);
-#__PACKAGE__->meta->make_immutable;
+sub display_name{ shift->name }
+
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
1;
package # hide from PAUSE
RTest::TestDB::Baz;
-use DBIx::Class 0.07;
+use base qw/DBIx::Class::Core/;
+use metaclass 'Reaction::Meta::Class';
+use Moose;
-use base qw/DBIx::Class Reaction::Object/;
-use Reaction::Class;
-use Reaction::Types::Core 'NonEmptySimpleStr';
+use MooseX::Types::Moose qw/ArrayRef Int/;
+use Reaction::Types::Core qw/NonEmptySimpleStr/;
-has 'id' => (isa => 'Int', is => 'ro', required => 1);
+has 'id' => (isa => Int, is => 'ro', required => 1);
has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
-has 'foo_list' => (isa => 'ArrayRef', is => 'ro', required => 1);
+has 'foo_list' => (isa => ArrayRef, is => 'ro', required => 1);
-__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+use namespace::clean -except => [ 'meta' ];
__PACKAGE__->table('baz');
name => { data_type => 'varchar', size => 255 },
);
-sub display_name { shift->name; }
-
__PACKAGE__->set_primary_key('id');
__PACKAGE__->has_many('links_to_foo_list' => 'RTest::TestDB::FooBaz', 'baz');
__PACKAGE__->many_to_many('foo_list' => 'links_to_foo_list' => 'foo');
-#__PACKAGE__->meta->make_immutable;
+sub display_name { shift->name; }
+
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
1;
package # hide from PAUSE
RTest::TestDB::Foo;
-use DBIx::Class 0.07;
+use base qw/DBIx::Class::Core/;
+use metaclass 'Reaction::Meta::Class';
+use Moose;
-use base qw/DBIx::Class Reaction::Object/;
-use Reaction::Class;
-use Reaction::Types::Core 'NonEmptySimpleStr';
+use MooseX::Types::Moose qw/ArrayRef Int/;
+use Reaction::Types::Core qw/NonEmptySimpleStr/;
-has 'id' => (isa => 'Int', is => 'ro', required => 1);
+has 'id' => (isa => Int, is => 'ro', required => 1);
has 'first_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
has 'last_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
-has 'baz_list' => (
- isa => 'ArrayRef', is => 'rw', required => 1,
- reader => 'get_baz_list', writer => 'set_baz_list'
+has 'baz_list' =>
+ (
+ isa => ArrayRef,
+ required => 1,
+ reader => 'get_baz_list',
+ writer => 'set_baz_list'
);
-__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+use namespace::clean -except => [ 'meta' ];
__PACKAGE__->table('foo');
last_name => { data_type => 'varchar', size => 255 },
);
-sub display_name {
- my $self = shift;
- return join(' ', $self->first_name, $self->last_name);
-}
-
__PACKAGE__->set_primary_key('id');
__PACKAGE__->has_many('links_to_baz_list' => 'RTest::TestDB::FooBaz', 'foo');
__PACKAGE__->many_to_many('baz_list' => 'links_to_baz_list' => 'baz');
-{
- no warnings 'redefine';
- *get_baz_list = sub { [ shift->baz_list->all ] };
+sub display_name {
+ my $self = shift;
+ return join(' ', $self->first_name, $self->last_name);
}
+sub get_baz_list { [ shift->baz_list->all ] };
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
package # hide from PAUSE
RTest::TestDB::FooBaz;
-use DBIx::Class 0.07;
-
-use base qw/DBIx::Class/;
-
-__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+use base qw/DBIx::Class::Core/;
+use metaclass 'Reaction::Meta::Class';
+use Moose;
__PACKAGE__->table('foo_baz');
__PACKAGE__->belongs_to('foo' => 'RTest::TestDB::Foo');
__PACKAGE__->belongs_to('baz' => 'RTest::TestDB::Baz');
+__PACKAGE__->meta->make_immutable(inline_constructor => 0);
+
1;