[Dbix-class] Can't locate object method "source_name" via package

Tony cshtreck at yahoo.com
Sat Dec 9 00:53:12 GMT 2006


yup ... it was a syntax error. SchemaLoader dumped my
files w/ the 'package My::SchemaLoader::TESDB::Table1'
at the top of my class files. I fixed this w/ 
sed -a -i .bk -e 's/SchemaLoader/Schema/g' && rm -f
./*.bk

Thanks!

statement  
--- Brandon Black <blblack at gmail.com> wrote:

> On 12/8/06, Tony <cshtreck at yahoo.com> wrote:
> > I'm using
> >
> > DBIx::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/dbix-class@lists.rawmode.org/
> 



 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com



More information about the Dbix-class mailing list