On 12/8/06, Tony <[EMAIL PROTECTED]> wrote:
I'm usingDBIx::Class version 0.07003 Catalyst version 5.7001 The following command line program fails > cat ./t.pl #!/usr/local/bin/perl use lib '../lib'; use My::Schema::TESTDB; The error is: "Can't locate object method "source_name" via package "My::Schema::TESTDB::Table1" at /usr/local/lib/perl5/site_perl/5.8.7/DBIx/Class/Schema.pm line 280. Compilation failed in require at ./t.pl line 4. BEGIN failed--compilation aborted at ./t.pl line 4. Okay, so I added a 'source_name' method ... gsipt# grep source_name ../lib/My/Schema/TESTDB/Table1.pm __PACKAGE__->source_name("table1"); and it still fails. This code was working until I modified a different table in the db. After which I ran SchemaLoader to regenerate my Schema files and dumped them back into my TESTDB Schema directory ( lib/MY/Schema/TESTDB/ ) I grep'ed my old lib/MY/Schema/TESTDB.old/ directory and there's no method there named 'source_name'
source_name is an accessor in all DBIx::Class::ResultSource-derived objects, its not something you should be having to specify manually for the tables. You should try a "diff -urN" on the two directories (the old and new TESTDB directories) to see everything that might have changed. Another thing you might try is just "perl -c" on your table definition pms like Table1.pm, as I suspect this error could result from a syntax error in that file. Either that or post up the source of Table1.pm might help. -- Brandon _______________________________________________ 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]/
