From: Arthur Axel 'fREW' Schmidt Date: Thu, 6 May 2010 18:39:39 +0000 (-0500) Subject: make more role delegates work X-Git-Tag: v0.001000_07~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f73e4ac36aa022797c6a9dca0afb98f82a0c38c;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git make more role delegates work --- diff --git a/lib/DBIx/Class/DeploymentHandler.pm b/lib/DBIx/Class/DeploymentHandler.pm index d7583c1..a30ec4d 100644 --- a/lib/DBIx/Class/DeploymentHandler.pm +++ b/lib/DBIx/Class/DeploymentHandler.pm @@ -7,14 +7,13 @@ use Moose; extends 'DBIx::Class::DeploymentHandler::Dad'; # a single with would be better, but we can't do that # see: http://rt.cpan.org/Public/Bug/Display.html?id=46347 -with 'DBIx::Class::DeploymentHandler::WithSqltDeployMethod', - #'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => { - #interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage', - #class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator', - #delegate_name => 'deploy_method', - #attributes_to_assume => ['schema'], - #attributes_to_copy => [qw( databases upgrade_directory sql_translator_args )], - #}, +with 'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => { + interface_role => 'DBIx::Class::DeploymentHandler::HandlesDeploy', + class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator', + delegate_name => 'deploy_method', + attributes_to_assume => ['schema'], + attributes_to_copy => [qw( databases upgrade_directory sql_translator_args )], + }, 'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => { interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersioning', class_name => 'DBIx::Class::DeploymentHandler::VersionHandler::Monotonic', diff --git a/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm b/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm index 971c994..cb6f573 100644 --- a/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm +++ b/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm @@ -18,11 +18,6 @@ parameter delegate_name => ( required => 1, ); -parameter interface_role => ( - isa => 'Str', - required => 1, -); - parameter attributes_to_copy => ( isa => 'ArrayRef[Str]', default => sub {[]}, @@ -42,7 +37,8 @@ role { my $meta = Class::MOP::class_of($class_name); - has [map %{$_->clone}, map $meta->get_attribute($_), @{ $p->attributes_to_copy }]; + has $_->name => %{ $_->clone } + for grep { $_ } map $meta->get_attribute($_), @{ $p->attributes_to_copy }; has $p->delegate_name => ( is => 'ro',