What was I thinking - resultsource does not have an ->alias
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI.pm
index c9f816e..f70384d 100644 (file)
@@ -1023,7 +1023,7 @@ sub _execute {
 sub insert {
   my ($self, $source, $to_insert) = @_;
 
-  my $ident = $source->from; 
+  my $ident = $source->from;
   my $bind_attributes = $self->source_bind_attributes($source);
 
   my $updated_cols = {};
@@ -1287,7 +1287,8 @@ sub _resolve_ident_sources {
   # the reason this is so contrived is that $ident may be a {from}
   # structure, specifying multiple tables to join
   if ( Scalar::Util::blessed($ident) && $ident->isa("DBIx::Class::ResultSource") ) {
-    $alias2source->{$ident->alias} = $ident;
+    # this is compat mode for insert/update/delete which do not deal with aliases
+    $alias2source->{me} = $ident;
   }
   elsif (ref $ident eq 'ARRAY') {