Tests
This commit is contained in:
@ -57,15 +57,11 @@ func GetRelationshipModuleName(tableName string) string {
|
||||
}
|
||||
|
||||
// GetFilterFieldName returns the filter field name for a column
|
||||
// For ID fields with IN operator, pluralizes the name
|
||||
// For ID fields with IN operator, changes _id to _ids (e.g., machine_id -> machine_ids)
|
||||
func GetFilterFieldName(columnName string, useIN bool) string {
|
||||
if useIN && strings.HasSuffix(columnName, "_id") {
|
||||
// Remove _id, pluralize, add back _ids
|
||||
base := columnName[:len(columnName)-3]
|
||||
if base == "" {
|
||||
return "ids"
|
||||
}
|
||||
return naming.Pluralize(base) + "_ids"
|
||||
// Replace _id with _ids
|
||||
return columnName[:len(columnName)-2] + "ids"
|
||||
}
|
||||
if useIN && columnName == "id" {
|
||||
return "ids"
|
||||
|
||||
Reference in New Issue
Block a user