Correctly pluralize tables names in getAll and findWhere generated procedures.

This commit is contained in:
2022-09-08 10:40:59 -05:00
parent 4e0a173c76
commit 004e3c19bb
2 changed files with 4 additions and 4 deletions

View File

@ -432,8 +432,8 @@ macro generateProcsForModels*(dbType: type, modelTypes: openarray[type]): untype
for t in modelTypes:
let modelName = $(t.getType[1])
let getName = ident("get" & modelName)
let getAllName = ident("getAll" & modelName & "s")
let findWhereName = ident("find" & modelName & "sWhere")
let getAllName = ident("getAll" & pluralize(modelName))
let findWhereName = ident("find" & pluralize(modelName) & "Where")
let createName = ident("create" & modelName)
let updateName = ident("update" & modelName)
let deleteName = ident("delete" & modelName)