[Bast-commits] r4625 - DBIx-Class-Tree-NestedSet/lib/DBIx/Class/Tree
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Jul 25 01:43:23 BST 2008
Author: rafl
Date: 2008-07-25 01:43:22 +0100 (Fri, 25 Jul 2008)
New Revision: 4625
Modified:
DBIx-Class-Tree-NestedSet/lib/DBIx/Class/Tree/NestedSet.pm
Log:
Reload root col from database if we changed it after insert.
Modified: DBIx-Class-Tree-NestedSet/lib/DBIx/Class/Tree/NestedSet.pm
===================================================================
--- DBIx-Class-Tree-NestedSet/lib/DBIx/Class/Tree/NestedSet.pm 2008-07-25 00:43:17 UTC (rev 4624)
+++ DBIx-Class-Tree-NestedSet/lib/DBIx/Class/Tree/NestedSet.pm 2008-07-25 00:43:22 UTC (rev 4625)
@@ -73,10 +73,14 @@
my $row = $self->next::method(@_);
- $row->update({
- $root => $row->get_column( ($row->result_source->primary_columns)[0] ),
- }) unless defined $row->$root;
+ if (!defined $row->$root) {
+ $row->update({
+ $root => $row->get_column( ($row->result_source->primary_columns)[0] ),
+ });
+ $row->discard_changes;
+ }
+
return $row;
}
More information about the Bast-commits
mailing list