[Dbix-class] Example confusion -- my own
talexb at gmail.com
Fri Jun 23 03:15:29 CEST 2006
On 6/22/06, Ash Berlin <ash at cpan.org> wrote:
> Alex Beamish wrote:
> > So join => 'tracks' doesn't mean join to the `tracks' table, it
> > join to the `tracks' relationship, which happens to exist on the
> > `track' table. Just like in the first example you gave `cd' didn't
> > refer to a table, it referred to a relationship that just so
> > to be named the same as the table.
> > So does DBIx::Class drop the trailing 's' and look for the first
> > relationship in the other table?
> > The problem I'm having is that 'tracks' is in the Perl code, but
> > 'tracks' doesn't appear anywhere in the database, just 'track'. From
> > the database:
> When you say join on tracks, it uses the relationship "tracks", which in
> the case of the tutorial is defined via
> __PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Track');
> So, it then goes to MyDatabase::Main::Track and finds out what table that
> referes to, which in this case is "track"
> Any clearer?
Yes. Yes. Yes.
Now I see where 'tracks' was coming from.
Thank you. Thank you. My brain can rest now.
Alex Beamish (talexb)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dbix-class