More refactoring and tweaking, might_have support added
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Table.pm
index 734e1d9..d8b6658 100644 (file)
@@ -241,6 +241,11 @@ sub find_or_create {
   return defined($exists) ? $exists : $class->create($hash);
 }
 
+sub insert_or_update {
+  my $self = shift;
+  return ($self->in_database ? $self->update : $self->insert);
+}
+
 sub retrieve_all {
   my ($class) = @_;
   return $class->retrieve_from_sql( '1' );