On Thu, Feb 21, 2008 at 01:59:40PM +1000, Cian Barclay wrote:
> >On Wed, Feb 20, 2008 at 4:33 PM, Zbigniew Lukasiak <[EMAIL PROTECTED]>
> wrote:
> >
> >
> > He meant result_source:
> >
> http://cpan.uwinnipeg.ca/htdocs/DBIx-Class/DBIx/Class/ResultSet.html#result_source
> >
> >
> 
> Thanks Zbigniew and Toby, that's just what I needed to know. Is there
> a good way to call a class method and get a resultset to use?
> I'm using Widget::class_method($schema) to give it the schema
> from $self->result_source->schema. Is there a better way to do it?

Yes, don't write class methods in DBIC.

If the operation is on multiple rows, make it a resultset method.

If the operation is on a single row, make it a method on the row object.

If the operation is on a bunch of different things and neither of those
make sense, make it a method on the schema object.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to