From e0c59fcf0b54040d0ae958e57664ee825dbd8cd9 Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 22 Sep 2016 23:14:49 +0800 Subject: [PATCH] add more comments --- orm/models_boot.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/orm/models_boot.go b/orm/models_boot.go index 4dbb54a9..319785ce 100644 --- a/orm/models_boot.go +++ b/orm/models_boot.go @@ -103,6 +103,8 @@ func bootStrap() { goto end } + // set rel and reverse model + // RelManyToMany set the relTable models = modelCache.all() for _, mi := range models { for _, fi := range mi.fields.columns { @@ -155,6 +157,8 @@ func bootStrap() { } } + // check the rel filed while the relModelInfo also has filed point to current model + // if not exist, add a new field to the relModelInfo models = modelCache.all() for _, mi := range models { for _, fi := range mi.fields.fieldsRel { @@ -167,7 +171,6 @@ func bootStrap() { break } } - if inModel == false { rmi := fi.relModelInfo ffi := new(fieldInfo)