make more role delegates work
Arthur Axel 'fREW' Schmidt [Thu, 6 May 2010 18:39:39 +0000 (13:39 -0500)]
lib/DBIx/Class/DeploymentHandler.pm
lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm

index d7583c1..a30ec4d 100644 (file)
@@ -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',
index 971c994..cb6f573 100644 (file)
@@ -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',