Skip to content
Snippets Groups Projects
Commit 26d2e706 authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: object adaptor now correctly reconstructs dbID

parent c2eb1bf5
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ sub count_all {
$sql .= " WHERE $constraint ";
}
print STDOUT $sql,"\n";
# print STDOUT $sql,"\n";
my $sth = $self->prepare($sql);
$sth->execute;
......
......@@ -45,7 +45,9 @@ sub slicer { # take a slice of the object (if only we could inline in Perl!)
sub objectify { # turn the hashref into an object (if only we could inline in Perl!)
my ($self, $hashref) = @_;
return $self->object_class()->new( -adaptor => $self, map { ('-'.uc($_) => $hashref->{$_}) } keys %$hashref );
my $autoinc_id = $self->autoinc_id();
return $self->object_class()->new( -adaptor => $self, map { ('-'.uc( ($_ eq $autoinc_id) ? 'dbID' : $_ ) => $hashref->{$_}) } keys %$hashref );
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment