rodrigolive/mongoose — pull request #17 by allanwhiteford (2011-12-28 13:42:06+00:00)
Title: Consuming Mongoose from a role rather than a class

Allow Mongoose::Document to be consumed by an intermediate role
but still save documents etc. based on the original class
which consumed the intermediate role.

Mongoose currently breaks if one does this:

{
package MyRole;
use MooseX::Role::Parameterized;

role {
my $p = shift;
my %args = @_;
with 'Mongoose::Document';
};
}

{
package Thing;
use Moose;
with 'MyRole';
has 'myattrib' => ( is => 'rw', isa =>'Str');
}

package main;

my $thing=new Thing;

$thing->save;

this pull request allows the above to work.