modelmanager refactor complete
This commit is contained in:
@@ -68,7 +68,7 @@ class Item {
|
||||
// must override
|
||||
}
|
||||
|
||||
removeFromRelationships() {
|
||||
removeAllRelationships() {
|
||||
// must override
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class Note extends Item {
|
||||
var references = _.map(this.tags, function(tag){
|
||||
return {uuid: tag.uuid, content_type: tag.content_type};
|
||||
})
|
||||
|
||||
return references;
|
||||
}
|
||||
|
||||
@@ -47,11 +48,12 @@ class Note extends Item {
|
||||
super.removeItemAsRelationship(item);
|
||||
}
|
||||
|
||||
removeFromRelationships() {
|
||||
removeAllRelationships() {
|
||||
this.tags.forEach(function(tag){
|
||||
_.pull(tag.notes, this);
|
||||
tag.dirty = true;
|
||||
})
|
||||
}.bind(this))
|
||||
this.tags = [];
|
||||
}
|
||||
|
||||
static filterDummyNotes(notes) {
|
||||
|
||||
@@ -17,6 +17,7 @@ class Tag extends Item {
|
||||
var references = _.map(this.notes, function(note){
|
||||
return {uuid: note.uuid, content_type: note.content_type};
|
||||
})
|
||||
|
||||
return references;
|
||||
}
|
||||
|
||||
@@ -45,11 +46,13 @@ class Tag extends Item {
|
||||
super.removeItemAsRelationship(item);
|
||||
}
|
||||
|
||||
removeFromRelationships() {
|
||||
removeAllRelationships() {
|
||||
this.notes.forEach(function(note){
|
||||
_.pull(note.tags, this);
|
||||
note.dirty = true;
|
||||
})
|
||||
}.bind(this))
|
||||
|
||||
this.notes = [];
|
||||
}
|
||||
|
||||
get content_type() {
|
||||
|
||||
Reference in New Issue
Block a user