singularize, less S::L, more win
Arthur Axel 'fREW' Schmidt [Fri, 28 May 2010 05:20:42 +0000 (00:20 -0500)]
slideshow.html

index 8ae42cb..d419494 100644 (file)
@@ -598,47 +598,29 @@ sub new {
 1;</pre>
 
    <div class="slide">
-      <h1>relationships</h1>
+      <h1>Relationships</h1>
    </div>
 
    <div class="slide">
-      <h1>multiple authors</h1>
+      <h1>Multiple Authors</h1>
    </div>
 
    <div class="slide">
       <h1>a few relationships</h1>
+      (really need picture here)
       (authors -- author_link_to_book -- books)
    </div>
 
    <div class="slide">
-      <h1>a few relationships</h1>
-      !
-   </div>
-
-   <div class="slide">
-      <h1>new join table</h1>
+      <h1>Join Table</h1>
 <pre>CREATE TABLE author_and_books(
-  id      int(8)    primary key auto_increment,
-  book    int(8),
-  author  int(8),
-  foreign key (book)     references books(id),
-  foreign key (author)   references authors(id)
+  book_id    int(8),
+  author_id  int(8),
+  foreign key (book_id)     references books(id),
+  foreign key (author_id)   references authors(id)
 ) engine = InnoDB DEFAULT CHARSET=utf8;
 
-ALTER TABLE `books` DROP `author`</pre>
-   </div>
-
-   <div class="slide">
-      <h1>new join table</h1>
-<pre>CREATE TABLE author_and_books(
-  id      int(8)    primary key auto_increment,
-  book    int(8),
-  author  int(8),
-  <strong>foreign key (book)     references books(id),
-  foreign key (author)   references authors(id)</strong>
-) engine = InnoDB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `books` DROP `author`</pre>
+ALTER TABLE `books` DROP `author`;</pre>
    </div>
 
    <div class="slide">
@@ -647,26 +629,11 @@ ALTER TABLE `books` DROP `author`</pre>
 
    <div class="slide">
       <h1>has_many</h1>
-<pre>package Foo::Schema::<strong>Result::Books</strong>;
+<pre>package Foo::Schema::<strong>Result::Book</strong>;
 
-__PACKAGE__-&gt;has_many( author_and_books =&gt; "Foo::Schema::Result::AuthorAndBooks",
-    { "foreign.book" =&gt; "self.id" },
+__PACKAGE__-&gt;has_many( author_and_books =&gt;
+   'Foo::Schema::Result::Author_Book', 'book_id'
 );
-
-<strong># This is auto generated by Schema::Loader</strong></pre>
-   </div>
-
-   <div class="slide">
-      <h1>has_many</h1>
-<pre>package Foo::Schema::<strong>Result::Books</strong>;
-
-__PACKAGE__-&gt;has_many(
-author_and_books =&gt; <strong># name of accessor</strong>
-"Foo::Schema::Result::AuthorAndBooks", <strong># related class</strong>
-    { "foreign.book" =&gt; "self.id" } <strong># Relationship (magic often works if not
-                                        # specified, but avoid!)</strong>
-);
-</pre>
    </div>
 
    <div class="slide">
@@ -675,12 +642,11 @@ author_and_books =&gt; <strong># name of accessor</strong>
 
    <div class="slide">
       <h1>belongs_to</h1>
-<pre>package Foo::Schema::<strong>Result::AuthorAndBooks</strong>;
+<pre>package Foo::Schema::<strong>Result::Author_Book</strong>;
 
 __PACKAGE__-&gt;belongs_to(
-   book =&gt; <strong># Accessor name</strong>
-   "Foo::Schema::Result::Books", <strong># Related class</strong>
-   { id =&gt; "book" } <strong># relationship</strong>
+   book =&gt;
+   'Foo::Schema::Result::Book', 'book_id'
 );
 </pre>
    </div>
@@ -690,10 +656,6 @@ __PACKAGE__-&gt;belongs_to(
    </div>
 
    <div class="slide">
-      <h1>with no coding...</h1>
-   </div>
-
-   <div class="slide">
       <h1>many_to_many</h1>
    </div>
 
@@ -703,12 +665,11 @@ __PACKAGE__-&gt;belongs_to(
 use base 'DBIx::Class::Core';
 
 __PACKAGE__-&gt;many_to_many(
-   authors =&gt; "author_and_books", 'author'
+   authors =&gt; 'author_and_books', 'author'
 );
 
 1;
-
-<strong> # This is <em>NOT</em> auto generated by Schema::Loader </strong></pre>
+</pre>
    </div>
 
    <div class="slide">
@@ -737,8 +698,7 @@ __PACKAGE__-&gt;many_to_many(
 );
 
 1;
-
-<strong># This is <em>NOT</em> auto generated by Schema::Loader</strong></pre>
+</pre>
    </div>
 
    <div class="slide">