From 53aaf3b4a94a41b0155ef7241c738cd48056a7ee Mon Sep 17 00:00:00 2001 From: slene Date: Mon, 10 Mar 2014 20:52:04 +0800 Subject: [PATCH] orm add ResetModelCache api for test case --- orm/models.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/orm/models.go b/orm/models.go index 5744d865..59a8a8a1 100644 --- a/orm/models.go +++ b/orm/models.go @@ -98,3 +98,9 @@ func (mc *_modelCache) clean() { mc.cacheByFN = make(map[string]*modelInfo) mc.done = false } + +// Clean model cache. Then you can re-RegisterModel. +// Common use this api for test case. +func ResetModelCache() { + modelCache.clean() +}