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
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/