pass _parent to collections
matthewt [Thu, 7 Feb 2008 08:52:49 +0000 (08:52 +0000)]
lib/Reaction/InterfaceModel/Reflector/DBIC.pm

index e986785..67747cf 100644 (file)
@@ -333,7 +333,11 @@ class DBIC, which {
        domain_model   => $dm_name,
        orig_attr_name => $source,
        default        => sub {
-         $collection->new(_source_resultset => shift->$dm_name->resultset($source));
+         my $self = $_[0];
+         return $collection->new(
+           _source_resultset => $self->$dm_name->resultset($source),
+           _parent => $self,
+         );
        },
       );