Conditions | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import Relation from "../Relation"; |
||
37 | getValueByParentKey(parentProperty) { |
||
38 | const type = this.$parent.className; |
||
39 | const id = this.$parent[parentProperty]; |
||
40 | const idKeyName = `${this.$name}_id`; |
||
41 | const idTypeName = `${this.$name}_type`; |
||
42 | |||
43 | const lookUpKey = {}; |
||
44 | lookUpKey[idKeyName] = id; |
||
45 | lookUpKey[idTypeName] = type; |
||
46 | |||
47 | return this.model.find(lookUpKey); |
||
48 | } |
||
49 | |||
57 | } |