Skip Menu |

This queue is for tickets about the Catalyst-Manual CPAN distribution.

Report information
The Basics
Id: 41491
Status: resolved
Priority: 0/
Queue: Catalyst-Manual

People
Owner: Nobody in particular
Requestors: Ian.Goodacre [...] xtra.co.nz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 5.7014
Fixed in: (no value)



Subject: file and path references in Create Static DBIC Schema Files
I am only trying Catalyst for the first time, so I may be wrong about this, but it appears a few of the file and path references in the section of Catalyst::Manual::Tutorial::MoreCatalystBasics are incorrect. If I am correct, the following diff might help improve the tutorial. $ diff -U 3 /usr/lib/perl5/site_perl/5.8.8/Catalyst/Manual/Tutorial/ MoreCatalystBasics.pod ./MoreCatalystBasics.pod --- /usr/lib/perl5/site_perl/5.8.8/Catalyst/Manual/Tutorial/ MoreCatalystBasics.pod 2008-11-05 10:33:06.000000000 +1300 +++ ./MoreCatalystBasics.pod 2008-12-07 09:10:21.000000000 +1300 @@ -761,12 +761,12 @@ a reference to the actual schema file in C<lib/MyApp/Schema.pm> along with the database connect string. -If you look in the C<lib/MyApp/Schema> directory, you will find that -C<DB.pm> is no longer using L<DBIx::Class::Schema::Loader> as its +If you look in the C<lib/MyApp> directory, you will find that +C<Schema.pm> is no longer using L<DBIx::Class::Schema::Loader> as its base class (L<DBIx::Class::Schema::Loader> is only being used by the helper to load the schema once and then create the static files for us) and that it only contains a call to the C<load_classes> method. You -will also find that C<lib/MyApp/Schema> contains a C<Schema> +will also find that C<lib/MyApp> contains a C<Schema> subdirectory, with one file inside this directory for each of the tables in our simple database (C<Authors.pm>, C<BookAuthors.pm>, and C<Books.pm>). These three files were created based on the information
Subject: file and path references in Catalyst::Manual::Tutorial::MoreCatalystBasics
From: Ian.Goodacre [...] xtra.co.nz
Sorry, I thought this was a bug report specific to Catalyst::Manual::Tutorial::MoreCatalystBasics.
From: Ian.Goodacre [...] xtra.co.nz
There were a few more errors in the remainder of the section, which may be addressed by the following: [ian@alula ~]$ diff -U 3 /usr/lib/perl5/site_perl/5.8.8/Catalyst/Manual/ Tutorial/MoreCatalystBasics.pod ./MoreCatalystBasics.pod --- /usr/lib/perl5/site_perl/5.8.8/Catalyst/Manual/Tutorial/ MoreCatalystBasics.pod 2008-11-05 10:33:06.000000000 +1300 +++ ./MoreCatalystBasics.pod 2008-12-07 10:09:28.000000000 +1300 @@ -761,12 +761,12 @@ a reference to the actual schema file in C<lib/MyApp/Schema.pm> along with the database connect string. -If you look in the C<lib/MyApp/Schema> directory, you will find that -C<DB.pm> is no longer using L<DBIx::Class::Schema::Loader> as its +If you look in the C<lib/MyApp> directory, you will find that +C<Schema.pm> is no longer using L<DBIx::Class::Schema::Loader> as its base class (L<DBIx::Class::Schema::Loader> is only being used by the helper to load the schema once and then create the static files for us) and that it only contains a call to the C<load_classes> method. You -will also find that C<lib/MyApp/Schema> contains a C<Schema> +will also find that C<lib/MyApp> contains a C<Schema> subdirectory, with one file inside this directory for each of the tables in our simple database (C<Authors.pm>, C<BookAuthors.pm>, and C<Books.pm>). These three files were created based on the information @@ -894,7 +894,28 @@ table-specific schema classes we created). Then hit the URL L<http://localhost:3000/books/list> and be sure that -the book list is displayed. +the relationships are loaded. + +B<Note:> You will not see the authors yet because the view does not +yet use the new relations. We will change the view a bit later. + +When you load the book list in your browser, you should see the following +queries logged by the test server: + + [info] MyApp powered by Catalyst 5.7015 + You can connect to your server at http://alula.local:3000 + SELECT me.id, me.title, me.rating FROM books me: + SELECT me.book_id, me.author_id FROM book_authors me WHERE ( me.book_id = ? ): '1' + SELECT me.book_id, me.author_id FROM book_authors me WHERE ( me.book_id = ? ): '2' + SELECT me.book_id, me.author_id FROM book_authors me WHERE ( me.book_id = ? ): '3' + SELECT me.book_id, me.author_id FROM book_authors me WHERE ( me.book_id = ? ): '4' + SELECT me.book_id, me.author_id FROM book_authors me WHERE ( me.book_id = ? ): '5' + [info] *** Request 1 (0.200/s) [20732] [Sun Dec 7 09:47:17 2008] *** + [debug] "GET" request for "books/list" from "127.0.0.1" + [debug] Path is "books/list" + [debug] Rendering template "books/list.tt2" + [info] Request took 0.715513s (1.398/s) + =head1 RUNNING THE APPLICATION FROM THE COMMAND LINE @@ -940,10 +961,10 @@ [% tt_authors.join(', ') | html %] </td> -Then hit C<Ctrl+R> in your browser (not that you don't need to reload +Then hit C<Ctrl+R> in your browser (note that you don't need to reload the development server or use the C<-r> option when updating TT -templates) and you should now the the number of authors each book and -a comma-separated list of the author's last names. +templates) and you should now see the the number of authors of each book +and a comma-separated list of the author's last names. If you are still running the development server with C<DBIC_TRACE> enabled, you should also now see five more C<SELECT> statements in the
Some of these were fixed during the recent removal of TTSite. Outstanding items resolved in svn # 9019 (http://dev.catalystframework.org/svnweb/Catalyst/revision/?rev=9019)