Use the more intelligent pluralization method we built when generating findXsByField lookup functions.

This commit is contained in:
2020-01-02 18:46:03 -06:00
parent 934bb26cf3
commit 61e06842af
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ macro generateProcsForModels*(dbType: type, modelTypes: openarray[type]): untype
macro generateLookup*(dbType: type, modelType: type, fields: seq[string]): untyped =
let fieldNames = fields[1].mapIt($it)
let procName = ident("find" & $modelType.getType[1] & "sBy" & fieldNames.mapIt(it.capitalize).join("And"))
let procName = ident("find" & pluralize($modelType.getType[1]) & "By" & fieldNames.mapIt(it.capitalize).join("And"))
# Create proc skeleton
result = quote do: