Toby Corkindale wrote:
Hi,
Start by assuming I'm smoking crack and do actually want to do this.. :)

If I have a $schema that is already initialised, and I decide I want to add a new relationship to one of my tables, what is the proper way to do so?

Is it this?
my $schema = ExampleApp->connect(..);
my $result_source = $schema->source('FooBar');
$result_source->has_many(something => 'ExampleApp::Wotsits');


Or perhaps this?
my $schema = ExampleApp->connect(..);
my $class = $schema->class('FooBar');
$class->has_many(something => 'ExampleApp::Wotsits');


I have my suspicions that neither are correct though.

PS. Assume the has_many() call is correct though, eg. if I had written
->has_many(something => 'ExampleApp::Wotsits', 'foobar');
rather than the incorrect version above.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to