- Fix as_subselect_rs to not inject resultset class-wide where
conditions outside of the resulting subquery
- Depend on optimized SQL::Abstract (faster SQL generation)
+ - update on row not in database now OK if no changes -
+ fixes problems with cascaded unnecessary updates
+
0.08121 2010-04-11 18:43:00 (UTC)
- Support for Firebird RDBMS with DBD::InterBase and ODBC
sub update {
my ($self, $upd) = @_;
- $self->throw_exception( "Not in database" ) unless $self->in_storage;
my $ident_cond = $self->{_orig_ident} || $self->ident_condition;
$self->set_inflated_columns($upd) if $upd;
my %to_update = $self->get_dirty_columns;
return $self unless keys %to_update;
+
+ $self->throw_exception( "Not in database" ) unless $self->in_storage;
+
my $rows = $self->result_source->storage->update(
$self->result_source, \%to_update, $ident_cond
);
is(scalar(keys(%fake_dirty)), 1, '1 fake dirty column');
ok(grep($_ eq 'name', keys(%fake_dirty)), 'name is fake dirty');
+ok($art->update, 'Update run');
+
my $record_jp = $schema->resultset("Artist")->search(undef, { join => 'cds' })->search(undef, { prefetch => 'cds' })->next;
ok($record_jp, "prefetch on same rel okay");
is($art->in_storage, 0, "It knows it's dead");
+lives_ok { $art->update } 'No changes so update should be OK';
+
dies_ok ( sub { $art->delete }, "Can't delete twice");
is($art->name, 'We Are In Rehab', 'But the object is still live');