[Bast-commits] r9026 - DBIx-Class/0.08/trunk/lib/DBIx/Class
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Thu Mar 18 14:59:55 GMT 2010
Author: frew
Date: 2010-03-18 14:59:55 +0000 (Thu, 18 Mar 2010)
New Revision: 9026
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
Log:
use update instead of set_columns in update_all
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2010-03-17 23:28:56 UTC (rev 9025)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2010-03-18 14:59:55 UTC (rev 9026)
@@ -1513,9 +1513,10 @@
my ($self, $values) = @_;
$self->throw_exception('Values for update_all must be a hash')
unless ref $values eq 'HASH';
- foreach my $obj ($self->all) {
- $obj->set_columns($values)->update;
- }
+
+ my $guard = $self->result_source->schema->txn_scope_guard;
+ $_->update($values) for $self->all;
+ $guard->commit;
return 1;
}
@@ -1566,7 +1567,9 @@
$self->throw_exception('delete_all does not accept any arguments')
if @_;
+ my $guard = $self->result_source->schema->txn_scope_guard;
$_->delete for $self->all;
+ $guard->commit;
return 1;
}
More information about the Bast-commits
mailing list