| 315 | } |
| 316 | |
| 317 | static _conformIncludes(options, self) { |
| 318 | if (!options.include) return; |
| 319 | |
| 320 | // if include is not an array, wrap in an array |
| 321 | if (!Array.isArray(options.include)) { |
| 322 | options.include = [options.include]; |
| 323 | } else if (!options.include.length) { |
| 324 | delete options.include; |
| 325 | return; |
| 326 | } |
| 327 | |
| 328 | // convert all included elements to { model: Model } form |
| 329 | options.include = options.include.map(include => this._conformInclude(include, self)); |
| 330 | } |
| 331 | |
| 332 | static _transformStringAssociation(include, self) { |
| 333 | if (self && typeof include === 'string') { |