Here's a patch for the Cookbook.

Thanks to mst for his help, as always.

Gavin.

-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way..... Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673
=== lib/DBIx/Class/Manual/Cookbook.pod
==================================================================
--- lib/DBIx/Class/Manual/Cookbook.pod	(revision 2523)
+++ lib/DBIx/Class/Manual/Cookbook.pod	(local)
@@ -1194,4 +1194,18 @@
       return $self->generate_description;
   }
 
+=head2 Dynamic Table Names
+
+Sometimes it is necessary to change your Result Source Tables names on the fly. Here's how:
+
+  my $cloned_schema = $schema->clone();
+  my $result_source = $schema->source('Artist');
+ 
+  # Change our TABLE name
+  $result_source->name( 'artist' . '51' );
+
+  $result_source->resultset->search({ mycol => 'blah' });
+
+Easy!
+
 =cut
_______________________________________________
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]/

Reply via email to