Fix incorrect relationship docs!
Jess Robinson [Sun, 5 Oct 2008 20:46:56 +0000 (20:46 +0000)]
lib/DBIx/Class/Relationship.pm

index 8de8cc0..228499b 100644 (file)
@@ -31,9 +31,9 @@ DBIx::Class::Relationship - Inter-table relationships
   MyDB::Schema::Actor->many_to_many('roles' => 'actorroles', 'role');
 
   ## Using relationships
-  $schema->resultset('Actor')->roles();
-  $schema->resultset('Role')->search_related('actors', { Name => 'Fred' });
-  $schema->resultset('ActorRole')->add_to_roles({ Name => 'Sherlock Holmes'});
+  $schema->resultset('Actor')->find({ id => 1})->roles();
+  $schema->resultset('Role')->find({ id => 1 })->actorroles->search_related('actor', { Name => 'Fred' });
+  $schema->resultset('Actor')->add_to_roles({ Name => 'Sherlock Holmes'});
 
 See L<DBIx::Class::Manual::Cookbook> for more.