initial parameterised role to get rid of WithFoos
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithMonotonicVersions.pm
CommitLineData
4a65f60b 1package DBIx::Class::DeploymentHandler::WithMonotonicVersions;
2use Moose::Role;
3
9deabd1f 4# ABSTRACT: Delegate/Role for DBIx::Class::DeploymentHandler::VersionHandler::Monotonic
5
4a65f60b 6use DBIx::Class::DeploymentHandler::VersionHandler::Monotonic;
7
8has version_handler => (
9 is => 'ro',
10 lazy_build => 1,
11 does => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
12 handles => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
13);
14
15sub _build_version_handler {
16 my $self = shift;
17
18 my $args = {
19 database_version => $self->database_version,
20 schema_version => $self->schema_version,
21 };
22
23 $args->{to_version} = $self->to_version if $self->has_to_version;
24 DBIx::Class::DeploymentHandler::VersionHandler::Monotonic->new($args);
25}
26
271;
28
e52174e3 29# vim: ts=2 sw=2 expandtab
4a65f60b 30
e52174e3 31__END__
feca70da 32
33=head1 DELEGATION ROLE
34
35This role is entirely for making delegation look like a role. The actual
36docs for the methods and attributes are at
37L<DBIx::Class::DeploymentHandler::VersionHandler::Monotonic>