no need to set resultset_class with load_namespaces, and a couple other minor changes
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 04_BasicCRUD.pod
index 2b2498d..cd3f0c4 100644 (file)
@@ -230,13 +230,10 @@ Ctrl+Reload your browser at the C</books/list> page).  You should now
 see the six DBIC debug messages similar to the following (where 
 N=1-6):
 
-    SELECT author.id, author.first_name, author.last_name \
-        FROM book_author me  JOIN author author \
+    SELECT author.id, author.first_name, author.last_name 
+        FROM book_author me  JOIN author author 
         ON author.id = me.author_id WHERE ( me.book_id = ? ): 'N'
 
-(The '\' characters won't actually appear in the output -- we are 
-using them as "line continuation markers" here.)
-
 
 =head1 CONVERT TO A CHAINED ACTION
 
@@ -1000,7 +997,8 @@ Next, we should re-run the DBIC helper to update the Result Classes
 with the new fields:
 
     $ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
-        create=static components=TimeStamp dbi:SQLite:myapp.db
+        create=static components=TimeStamp dbi:SQLite:myapp.db \
+        on_connect_do="PRAGMA foreign_keys = ON"
      exists "/root/dev/MyApp/script/../lib/MyApp/Model"
      exists "/root/dev/MyApp/script/../t"
     Dumping manual schema for MyApp::Schema to directory /root/dev/MyApp/script/../lib ...
@@ -1102,7 +1100,7 @@ Then open C<lib/MyApp/Schema/ResultSet/Book.pm> and enter the following:
     sub created_after {
         my ($self, $datetime) = @_;
     
-        my $date_str = $self->_source_handle->schema->storage
+        my $date_str = $self->result_source->schema->storage
                               ->datetime_parser->format_datetime($datetime);
     
         return $self->search({
@@ -1112,15 +1110,6 @@ Then open C<lib/MyApp/Schema/ResultSet/Book.pm> and enter the following:
     
     1;
 
-Then we need to tell the Result Class to to treat this as a ResultSet
-Class.  Open C<lib/MyApp/Schema/Result/Book.pm> and add the following
-above the "C<1;>" at the bottom of the file:
-
-    #
-    # Set ResultSet Class
-    #
-    __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Book');
-
 Then add the following method to the C<lib/MyApp/Controller/Books.pm>:
 
     =head2 list_recent