Permalink
Browse files

Checkpoint. Removing entities working.

  • Loading branch information...
1 parent 297896f commit 5c93f7ee4885aa5685af8be611b99b630d564e17 @jhannah committed Mar 29, 2011
@@ -24,9 +24,8 @@ L<http://blog.woobling.org/2009/06/users-accounts-identities-and-roles.html>
=cut
sub get_identity {
- my $self = shift;
- my ($user_id) = @_;
- return $self->lookup("identity:$user_id");
+ my ($self, $id) = @_;
+ return $self->lookup("identity:$id");
}
=head1 VERSION CONTROL
@@ -1,5 +1,7 @@
package KiokuX::Model::UserAccounts::Identity;
use Moose::Role;
+use Moose::Util::TypeConstraints;
+role_type('KiokuX::Model::UserAccounts::User');
with qw(
KiokuX::User
@@ -8,7 +10,7 @@ with qw(
has user => (
is => 'rw',
- isa => 'Narwhal::User',
+ isa => 'KiokuX::Model::UserAccounts::User',
);
no Moose::Role;
@@ -1,5 +1,7 @@
package KiokuX::Model::UserAccounts::User;
use Moose::Role;
+use Moose::Util::TypeConstraints;
+role_type('KiokuX::Model::UserAccounts::Identity');
has name => (
is => 'rw',
@@ -9,10 +11,7 @@ has name => (
has identities => (
traits => ['Array'],
is => 'rw',
- # TODO Hmm... what I really want is:
- # isa => 'ArrayRef[KiokuX::Model::UserAccounts::Identity]',
- # but that's a Role not a Class... hmmm... --jhannah 20110328
- isa => 'ArrayRef[Narwhal::Identity]',
+ isa => 'ArrayRef[KiokuX::Model::UserAccounts::Identity]',
default => sub { [] },
handles => {
all_identities => 'elements',

0 comments on commit 5c93f7e

Please sign in to comment.