Skip to content

Commit d2dd49e

Browse files
committed
revert mocks to mock_ prefix convention
1 parent d26ef91 commit d2dd49e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

database/repositories/statistics_repository.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ func (r *statisticsRepository) TimeTravelDependencyVulnState(ctx context.Context
5353
} else {
5454
err = r.GetDB(ctx, tx).Model(&models.DependencyVuln{}).Select("dependency_vulns.*").Preload("CVE").Preload("Events", func(db *gorm.DB) *gorm.DB {
5555
return db.Where("created_at <= ?", time).Order("created_at ASC")
56-
}).Where("adv.artifact_asset_id = ?", assetID).Where("adv.artifact_artifact_name = ?", artifactName).Where("created_at <= ?", time).
56+
}).
57+
Joins("JOIN artifact_dependency_vulns adv ON adv.dependency_vuln_id = dependency_vulns.id").
58+
Where("adv.artifact_asset_id = ?", assetID).Where("adv.artifact_artifact_name = ?", artifactName).Where("created_at <= ?", time).
5759
Find(&dependencyVulns).Error
5860
}
5961
if err != nil {

0 commit comments

Comments
 (0)