I've come across a bug in the cookbook code for 'Arbitrary SQL
through a custom ResultSource'.  If you name resultsets by full
class name and have defined a complex query using the suggested code
you will find the class_mapping is poisoned and your normal
resultsource maps to the complex resultsource when using the full
class name.

This is fixed by the attached diff.

  Enjoy,
  -ljr
Index: Cookbook.pod
===================================================================
--- Cookbook.pod        (revision 4845)
+++ Cookbook.pod        (working copy)
@@ -90,7 +90,9 @@
   # Make a new ResultSource based on the User class
   my $source = __PACKAGE__->result_source_instance();
   my $new_source = $source->new( $source );
+
   $new_source->source_name( 'UserFriendsComplex' );
+  $new_source->result_class( 'My::Schema::UserFriendsComplex' );
   
   # Hand in your query as a scalar reference
   # It will be added as a sub-select after FROM,
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to