[Catalyst-commits] r12341 - trunk/examples/CatalystAdvent/root/2009
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Sun Dec 13 08:33:57 GMT 2009
Author: dhoss
Date: 2009-12-13 08:33:57 +0000 (Sun, 13 Dec 2009)
New Revision: 12341
Modified:
trunk/examples/CatalystAdvent/root/2009/13.pod
Log:
minor changes to code tags
Modified: trunk/examples/CatalystAdvent/root/2009/13.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/13.pod 2009-12-13 08:21:58 UTC (rev 12340)
+++ trunk/examples/CatalystAdvent/root/2009/13.pod 2009-12-13 08:33:57 UTC (rev 12341)
@@ -58,7 +58,7 @@
1;
-Basically, you load up the MatPath stuff as a component (C<__PACKAGE__->load_components(qw/ Tree::Ordered::MatPath Core /);>),
+Basically, you load up the MatPath stuff as a component (C<< __PACKAGE__->load_components(qw/ Tree::Ordered::MatPath Core /); >>),
and set up your table. The main thing to look at is making sure you have a column to keep track of parent ids and the row's
path. Those are used by ::Ordered to group and move things around in the path/tree, which is the bulk of the materialized
path manipuation work. Creating a record is pretty standard, and MatPath takes care of the path building for you.
@@ -67,7 +67,7 @@
my $reply = $c->model('Board::Thread')->create($params);
$reply->update({ parent_id => $parent->thread_id }) or die "Error :$!";
-This is obviously done using the C<$c->model(...)> approach via Catalyst, but that's just saying C<$schema->resultset(...)> in essence.
+This is obviously done using the C<< $c->model(...) >> approach via Catalyst, but that's just saying C<< $schema->resultset(...) >> in essence.
What this does is create a new record, then update it so that its parent_id now matches its parent's thread id. That's it.
It's thankfully a very simple process that saves a lot of stress on your database server and helps keep things neat and tidy.
More information about the Catalyst-commits
mailing list