=item coderef
In which case the coderef should return a string GUID, using L<Data::GUID>, or
-whatever GUID generation method you prefer.
+whatever GUID generation method you prefer. It is passed the C<$self>
+L<DBIx::Class::Storage> reference as a parameter.
=back
sub _prefetch_autovalues {
my $self = shift;
- my ($source, $to_insert) = @_;
-
- my $col_info = $source->columns_info;
+ my ($source, $col_info, $to_insert) = @_;
my %guid_cols;
my @pk_cols = $source->primary_columns;
if (not defined $guid_method) {
$self->throw_exception(
- 'You must set new_guid on your storage. See perldoc '
+ 'You must set new_guid() on your storage. See perldoc '
.'DBIx::Class::Storage::DBI::UniqueIdentifier'
);
}
if (ref $guid_method eq 'CODE') {
- $to_insert->{$guid_col} = $guid_method->();
+ $to_insert->{$guid_col} = $guid_method->($self);
}
else {
($to_insert->{$guid_col}) = $self->_get_dbh->selectrow_array("SELECT $guid_method");