chore: 🤖 introduce Scope model with self relationships

This commit is contained in:
Randall Morey committed 2020-07-14 18:47:35 -04:00
1 parent a02c7c656b
commit eb4b29ac1b
5 files changed
+108

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import GeneratedScopeModel from '../generated/models/scope';
import { belongsTo, hasMany } from '@ember-data/model';
export default class ScopeModel extends GeneratedScopeModel {
// =relationships
/**
* The parent scope, if any.
* @type {ScopeModel}
*/
@belongsTo('scope', {inverse: 'childrenScopes'}) parentScope;
/**
* The inverse of parent scope, children.
* @type {ScopeModelp[]}
*/
@hasMany('scope', {inverse: 'parentScope'}) childrenScopes;
}