| 338 | } |
| 339 | |
| 340 | static _conformIncludes(options, self) { |
| 341 | if (!options.include) return; |
| 342 | |
| 343 | // if include is not an array, wrap in an array |
| 344 | if (!Array.isArray(options.include)) { |
| 345 | options.include = [options.include]; |
| 346 | } else if (!options.include.length) { |
| 347 | delete options.include; |
| 348 | return; |
| 349 | } |
| 350 | |
| 351 | // convert all included elements to { model: Model } form |
| 352 | options.include = options.include.map(include => this._conformInclude(include, self)); |
| 353 | } |
| 354 | |
| 355 | static _transformStringAssociation(include, self) { |
| 356 | if (self && typeof include === 'string') { |