> Am 24.05.2007 um 18:28 schrieb Matt S Trout: > > On Thu, May 24, 2007 at 03:18:46PM +0200, Tobias Kremer wrote: > >>> The problem is that even calls on MyApp::Schema::User ResultSets to > >>> standard relationships defined via has_many trigger the execution > >>> of the > >>> manually added ResultSource above - which of course fails with a > >>> "called with x bind variables when y are needed" error message. > >> > >> Correction: Calls to standard relationships DO work fine but I > >> have custom > >> methods in MyApp::Schema::User that use these relationships and > >> they stop > >> working: > > > > Can you show the calling code, please?
Ok, I tried to strip down my schema so that you can have a look at it: http://www.funkreich.de/files/dbic_wreck.tar.gz runme.pl fails on my system - The call to custom_method() tries to use the ResultSource that is created in Wreck::Schema::User although it should just use the "normal" relationship called relation_a (notice the "I AM NOT SUPPOSED TO BE CALLED" string in the output). The "prefetch" parameter in custom_method seems to somehow have to do with this. What I find most interesting is the fact that the name given to ->register_source in Wreck::Schema::User has an influence on the whole case. Try changing it from "MyResultSource" to "UserMutual" and suddenly everything works as intended. What kind of magic is going on there under the hood? :) --Tobias _______________________________________________ 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/ Searchable Archive: http://www.mail-archive.com/[email protected]/
