[Dbix-class] Schema::Loader and has_many
Vsevolod (Simon) Ilyushchenko
simonf at cshl.edu
Wed Mar 22 14:06:29 CET 2006
Hi,
With Brandon's help, I've created a simple example that uses
Schema::Loader, but I've hit a snag when I tried to use has_many.
First, the loader was created in the file Test/Schema.pm, and my model
classes were in Test/M/Class.pm. The problem is that if I can't call
__PACKAGE__->has_many(...) inside Test/M/Class.pm, which inherits only
from Catalyst::Model::DBIC::Schema at the time the file is loaded.
I've realized that the auto-loaded classes are called
Test/Schema/Class.pm, so I've renamed my schema to M.pm. However, this
caused other weird problems (I can give more details if necessary).
What is the right way to specify relationships with Loader?
Thanks,
Simon
--
Simon (Vsevolod ILyushchenko) simonf at cshl.edu
http://www.simonf.com
"Think like a man of action, act like a man of thought."
Henri Bergson
More information about the Dbix-class
mailing list