Revision history for DBIx::Class
+ - renamed insert_or_update to update_or_insert (with compat alias)
- renamed cols attribute to columns (cols still supported)
- added has_column_loaded to Row
- Storage::DBI connect_info supports coderef returning dbh as 1st arg
return $new;
}
-=head2 insert_or_update
+=head2 update_or_insert
- $obj->insert_or_update
+ $obj->update_or_insert
Updates the object if it's already in the db, else inserts it.
=cut
-sub insert_or_update {
+*insert_or_update = \&update_or_insert;
+sub update_or_insert {
my $self = shift;
return ($self->in_storage ? $self->update : $self->insert);
}
unlink 't/var/dbic.trace';
is($selects, 1, 'prefetch ran only 1 select statement');
-# test for partial prefetch via cols attr
+# test for partial prefetch via columns attr
my $cd = $schema->resultset('CD')->find(1,
{
- cols => [qw/title artist.name/],
+ columns => [qw/title artist.name/],
join => { 'artist' => {} }
}
);