Allow 'rel' and 'relation'

This commit is contained in:
Fabien Franzen 2014-10-10 14:32:14 +02:00
parent 0c28ccedac
commit 771d9505cc
1 changed files with 3 additions and 2 deletions

View File

@ -14,9 +14,10 @@ function normalizeInclude(include) {
} else if (isPlainObject(include)) {
// Build an array of key/value pairs
var newInclude = [];
if (typeof include.relation === 'string' && isPlainObject(include.scope)) {
var rel = include.rel || include.relation;
if (typeof rel === 'string' && isPlainObject(include.scope)) {
var obj = {};
obj[include.relation] = new IncludeScope(include.scope);
obj[rel] = new IncludeScope(include.scope);
newInclude.push(obj);
} else {
for (var key in include) {