cosmincx's patch to show relationship attr filtering in cookbook
Jess Robinson [Mon, 6 Oct 2008 18:16:07 +0000 (18:16 +0000)]
lib/DBIx/Class/Manual/Cookbook.pod

index 941aab3..293363d 100644 (file)
@@ -905,6 +905,12 @@ as follows:
 
   __PACKAGE__->has_many('pages' => 'Page', 'book', { order_by => \'page_number DESC'} );
 
+=head2 Filtering a relationship result set
+
+If you want to get a filtered result set, you can just add add to $attr as follows:
+
+ __PACKAGE__->has_many('pages' => 'Page', 'book', { where => { scrap => 0 } } );
+
 =head2 Many-to-many relationships
 
 This is straightforward using L<ManyToMany|DBIx::Class::Relationship/many_to_many>: