Closed manon-gfx closed 9 months ago
@manon-gfx I'm afraid that this change breaks the tests TestFindMissing
and TestExpiry
. I don't use gorm myself, and haven't researched it, but I suspect that the reason is that Find()
doesn't return a gorm.ErrRecordNotFound
error if no matching record exists.
I've fixed this issue in master
in a way that avoids breaking the tests.
When using the
First
function,gorm
will log that it failed to find a record. Since this case is valid inscs
it makes no sense to log it. By using different syntax the same functionality is achieved but without the logging.