Hello all!  I'm an old but rusty Perl programmer - and a noob to the
modern Perl frameworks.  I'm inheriting a site that uses Catalyst and
Kioku but am getting the following error when trying to instantiate an
object User.pm:

 User->register "Attribute (id) is required at
/home/alex/Desktop/ParkingMobility-Server/script/../support/lib/perl5/MooseX/Aliases/Meta/Trait/Attribute.pm
line 70

...the User.pm object looks like:

package MyProject::Model::User;
use Moose;
use namespace::autoclean;
use MooseX::Aliases;
use MooseX::Types::Email qw/EmailAddress/;

with qw(
  KiokuX::User
  MyProject::Data::Serialize
  MyProject::Data::ObjectKey
  MyProject::Model::Does::TimeStamp
  KiokuDB::Role::Upgrade::Handlers::Table
);

has email => (
    isa      => EmailAddress,
    is       => 'ro',
    traits   => [qw(Aliased)],
    alias    => [qw(id kiokudb_object_id key)],
    required => 1,
);

Can someone explain to me why the "id" attribute alias is not being
picked up?  Shouldn't "email" and "id" now be synonymous now that it's
"Aliased"?  I've tried to define an "id" attribute but this results in
an error telling me that I'm attempting to override the attribute "id"
(defined in KiokuX::User).

If anyone can't point me in the right direction, I'd be sincerely grateful!

Cheers,

Alex

Reply via email to