chore: 🤖 introduce Scope model with self relationships
This commit is contained in:
5 files changed
+108
No files matched your search
@@ -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;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user