[Catalyst-commits] r12166 -
trunk/examples/Advent09FormHandlerBlog/Blog/lib/Blog/Form
alexn_org at dev.catalyst.perl.org
alexn_org at dev.catalyst.perl.org
Thu Dec 3 17:14:36 GMT 2009
Author: alexn_org
Date: 2009-12-03 17:14:36 +0000 (Thu, 03 Dec 2009)
New Revision: 12166
Modified:
trunk/examples/Advent09FormHandlerBlog/Blog/lib/Blog/Form/Article.pm
Log:
replaced schema init with self->schema
Modified: trunk/examples/Advent09FormHandlerBlog/Blog/lib/Blog/Form/Article.pm
===================================================================
--- trunk/examples/Advent09FormHandlerBlog/Blog/lib/Blog/Form/Article.pm 2009-12-03 17:04:01 UTC (rev 12165)
+++ trunk/examples/Advent09FormHandlerBlog/Blog/lib/Blog/Form/Article.pm 2009-12-03 17:14:36 UTC (rev 12166)
@@ -30,9 +30,7 @@
my $self = shift;
my $item = $self->item;
- my $schema = $item->result_source->schema;
-
- my $changes = sub {
+ $self->schema->txn_do(sub {
$orig->($self, @_);
my @tags = split /\s*,\s*/, $self->field('tags_str')->value;
@@ -43,9 +41,7 @@
my $summary = generate_symmary($item->content);
$item->update({ summary => $summary }) if $summary;
- };
-
- $schema->txn_do($changes);
+ });
};
sub generate_symmary {
More information about the Catalyst-commits
mailing list