[Dbix-class] I can't use two own components that use ResultSetManager.
David Kamholz
davekam at pobox.com
Thu Mar 16 05:58:34 CET 2006
On Mar 14, 2006, at 1:43 PM, atsushi kobayashi wrote:
>
> my $schema = DBIC->connect(...);
> my $it;
> $it = $schema->resultset('Test')->foo(); # ok
> $it = $schema->resultset('Test')->bar(); # not ok
>
>
> The ResultSet attribute exist in the method of the foo.
> But the ResultSet attribute doesn't exist in the method of the bar.
>
> Is my usage wrong?
Hmmmm... this is rather strange. I don't really see why it should be
happening, but ResultSetManager does some somewhat evil things by
moving a sub from one class to another. Try seeing what's happening
in ResultSetManager.pm in _register_attributes -- in particular these
lines:
*{"$resultset_class\::$meth"} = $self->can($meth);
delete ${"${self}::"}{$meth};
You might try changing the first line to:
*{"$resultset_class\::$meth"} = \&{"$self::\$meth};
In any case, make sure that it's trying at all to move both methods
into the table-specific ResultSet class. I'd appreciate any further
information you can give on this -- it's a bit tricky doing stuff
like this.
Dave
More information about the Dbix-class
mailing list