On 5/18/07, Guillermo Roditi <[EMAIL PROTECTED]> wrote:
Correction, you want to add it to the ResultSet class, not the result class! and yes there's a way. http://search.cpan.org/~blblack/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Predefined_searches <http://search.cpan.org/%7Eblblack/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Predefined_searches> http://search.cpan.org/~jrobinson/DBIx-Class-0.07999_02/lib/DBIx/Class/Storage/DBI.pm<http://search.cpan.org/%7Ejrobinson/DBIx-Class-0.07999_02/lib/DBIx/Class/Storage/DBI.pm> $self->result_source->schema->storage
That makes sense, but for some reason when I follow the example it wont let me start my server. I create a directory under myDB called ResultSet, and put an object call TestRes.pm in there which contains: package myDB::ResultSet::TestRes; use strict; use warnings; use base 'DBIx::Class::ResultSet'; 1; and when I try to start the catalyst server I get: Couldn't instantiate component "MyApp::Model::myDB", "Cannot load schema class 'myDB': Can't locate object method "source_name" via package "myDB::ResultSet::TestRes" at /usr/local/share/perl/5.8.8/DBIx/Class/Schema.pm line 280. Compilation failed in require at /usr/local/share/perl/5.8.8/Catalyst/Model/DBIC/Schema.pm line 272.
From searching the web it says to check the other classes mentioned in the
error, all of which compile fine, and if I move the ResultSet folder out of my app, things are fine. Pulling at straws, I defined a method called source_name, which then just leads the compiler to throw another error. Any Ideas? Thanks! John
_______________________________________________ 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]/
