X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FWithApplicatorDumple.pm;h=107780bacae07ddb966a82db03225e205579bdd0;hb=e77651a89c60e38bd3f81da8a98084ca9160110c;hp=971c99486e968616d27cba379144fd39b8eca519;hpb=9f552252915d0b6cb4e369946aa6cb979990afe4;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm b/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm index 971c994..107780b 100644 --- a/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm +++ b/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm @@ -3,6 +3,13 @@ use MooseX::Role::Parameterized; use Class::MOP; use namespace::autoclean; +# this is at least a little ghetto and not super well +# thought out. Take a look at the following at some +# point to clean it all up: +# +# http://search.cpan.org/~jjnapiork/MooseX-Role-BuildInstanceOf-0.06/lib/MooseX/Role/BuildInstanceOf.pm +# http://github.com/rjbs/role-subsystem/blob/master/lib/Role/Subsystem.pm + parameter interface_role => ( isa => 'Str', required => 1, @@ -18,11 +25,6 @@ parameter delegate_name => ( required => 1, ); -parameter interface_role => ( - isa => 'Str', - required => 1, -); - parameter attributes_to_copy => ( isa => 'ArrayRef[Str]', default => sub {[]}, @@ -42,7 +44,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->find_attribute_by_name($_), @{ $p->attributes_to_copy }; has $p->delegate_name => ( is => 'ro',