Help for this page

Select Code to Download


  1. or download this
    package MyApp::Schema::Result::User;
    use Moose;
    ...
    __PACKAGE__->has_many( user_roles => 'MyApp::Schema::Result::UserRole'
    +, 'user_id' );
    
    __PACKAGE__->many_to_many( roles => 'user_roles', 'role' );
    
  2. or download this
    package MyApp::Schema::Result::Profile;
    use Moose;
    ...
    
    1;
    __END__
    
  3. or download this
    #!/usr/bin/env perl
    use lib 'lib';
    ...
        say "Username: " . $user->username;
        say "Name: ". $user->profile->name;
    }
    
  4. or download this
    DBIx::Class::Storage::BlockRunner::__ANON__(): No such column, relatio
    +nship, many-to-many helper accessor or generic accessor 'email' at /r
    +oot/perl5/lib/perl5/Context/Preserve.pm line 22
    DBIx::Class::Storage::BlockRunner::__ANON__(): No such column, relatio
    +nship, many-to-many helper accessor or generic accessor 'name' at /ro
    +ot/perl5/lib/perl5/Context/Preserve.pm line 22
    ...
    
    DBIx::Class::Storage::BlockRunner::__ANON__(): No such column, relatio
    +nship, many-to-many helper accessor or generic accessor 'profile.emai
    +l' at /root/perl5/lib/perl5/Context/Preserve.pm line 22
    DBIx::Class::Storage::BlockRunner::__ANON__(): No such column, relatio
    +nship, many-to-many helper accessor or generic accessor 'profile.name
    +' at /root/perl5/lib/perl5/Context/Preserve.pm line 22
    
  5. or download this
    package MyApp::Form::User;
    use HTML::FormHandler::Moose;
    ...
    __PACKAGE__->meta->make_immutable;
    no HTML::FormHandler::Moose;
    1;