From: Will Hawes Date: Wed, 25 Jun 2008 10:52:30 +0000 (+0000) Subject: clarify that ->resultset_class must be called after ->load_components and ->table... X-Git-Tag: v0.08240~422 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9dc1bfce52b2532765387957e20b21a119c9065a;p=dbsrgits%2FDBIx-Class.git clarify that ->resultset_class must be called after ->load_components and ->table when using custom resultsets --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index ef36172..e9ac0ad 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -255,8 +255,15 @@ and define often used searches as methods: To use your resultset, first tell DBIx::Class to create an instance of it for you, in your My::DBIC::Schema::CD class: + # class definition as normal + __PACKAGE__->load_components(qw/ Core /); + __PACKAGE__->table('cd'); + + # tell DBIC to use the custom ResultSet class __PACKAGE__->resultset_class('My::DBIC::ResultSet::CD'); +Note that C must be called after C and C, or you will get errors about missing methods. + Then call your new method in your code: my $ordered_cds = $schema->resultset('CD')->search_cds_ordered();