Comparing version 1.13.23 to 1.13.24
v1.13.23 / 2019-03-03 | ||
v1.13.24 / 2019-03-07 | ||
================== | ||
* code clean. | ||
* code clean. | ||
* fix error when generating diagram with `extendsTo` association type. | ||
* upgrade core dependency. | ||
v1.13.23 / 2019-03-03 | ||
===================== | ||
* Release v1.13.23 | ||
* support using rest api for extendsTo-type association. | ||
@@ -6,0 +15,0 @@ * rename `WEBX_CI_DB_DEBUG` to `WEBX_TEST_DB_DEBUG`. |
@@ -6,3 +6,3 @@ var Viz = require('viz.js'); | ||
var exts = []; | ||
this.db(db => { | ||
this.db((db) => { | ||
var m, m1; | ||
@@ -21,3 +21,7 @@ var ks; | ||
var one = m1.type === "hasOne" && !m1.reversed; | ||
exts.push(`${m.model_name} -> ${m1.model.model_name} [label=${e} ${one ? "arrowhead=empty" : ""}];`); | ||
var extendsTo = m1.type === "extendsTo"; | ||
if (!extendsTo) | ||
exts.push(`${m.model_name} -> ${m1.model.model_name} [label=${e} ${one ? "arrowhead=empty" : ""}];`); | ||
else | ||
exts.push(`${m.model_name} -> ${m1.assoc_model.model_name} [label=${e} ${one ? "arrowhead=empty" : ""}];`); | ||
} | ||
@@ -24,0 +28,0 @@ } |
@@ -25,6 +25,6 @@ /// <reference lib="es2017" /> | ||
let hasmany_assoc; | ||
let hasone_assoc; | ||
let found_assoc; | ||
const base_instance = new base_model(); | ||
if (findby.on | ||
&& (hasmany_assoc = orm_assoc_1.get_many_association_item(base_instance, findby.extend))) { | ||
&& (found_assoc = hasmany_assoc = orm_assoc_1.get_many_association_item(base_instance, findby.extend))) { | ||
// TODO: make sure order of mg_ks is corresponding to mks | ||
@@ -49,8 +49,9 @@ const mg_ks = Object.values(hasmany_assoc.mergeId).map(x => x.mapsTo); | ||
} | ||
else if (findby.where) { | ||
else if (findby.where | ||
&& ((found_assoc = orm_assoc_1.get_one_association_item(base_instance, findby.extend)) | ||
|| | ||
(found_assoc = orm_assoc_1.get_extendsto_association_item(base_instance, findby.extend)))) { | ||
let findby_conditions = findby.where; | ||
if (!filter_conditions(findby_conditions)) | ||
return __wrapper; | ||
const rel_model = base_model.extends[findby.extend]; | ||
const is_extendsTo = rel_model.type === 'extendsTo'; | ||
findby_conditions = convert_where(findby_conditions); | ||
@@ -60,3 +61,3 @@ if (!checkout_acl_1.checkout_acl(req.session, 'find', base_model.ACL, findby.extend)) | ||
let accessor_fn = null, accessor_name = null, accessor_payload = null; | ||
let findby_accessor_name = `findBy${str_1.ucfirst(findby.extend)}`; | ||
const findby_accessor_name = found_assoc.modelFindByAccessor || `findBy${str_1.ucfirst(findby.extend)}`; | ||
; | ||
@@ -63,0 +64,0 @@ [ |
{ | ||
"name": "fib-app", | ||
"version": "1.13.23", | ||
"version": "1.13.24", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
813959
3324