feat(news): Add relations

This commit is contained in:
Mrugesh Mohapatra
2018-07-31 01:36:56 +05:30
committed by mrugesh mohapatra
parent 2cce8bbfd5
commit 60719fcbe6
3 changed files with 24 additions and 2 deletions

View File

@ -68,7 +68,18 @@
} }
}, },
"validations": [], "validations": [],
"relations": {}, "relations": {
"user": {
"type": "belongsTo",
"model": "user",
"foreignKey": "externalId"
},
"popularity": {
"type": "hasOne",
"model": "popularity",
"foreignKey": "popularityId"
}
},
"acls": [], "acls": [],
"methods": {} "methods": {}
} }

View File

@ -15,7 +15,13 @@
} }
}, },
"validations": [], "validations": [],
"relations": {}, "relations": {
"article": {
"type": "belongsTo",
"model": "article",
"foreignKey": "articleId"
}
},
"acls": [], "acls": [],
"methods": {} "methods": {}
} }

View File

@ -284,6 +284,11 @@
"options": { "options": {
"disableInclude": true "disableInclude": true
} }
},
"articles": {
"type": "hasMany",
"model": "article",
"foreignKey": "externalId"
} }
}, },
"acls": [ "acls": [