Skip to content

Commit a9d8d96

Browse files
authored
Merge pull request #9 from jsonapi-suite/many_many_deleted_CP
CP to allow access to many to many deleted models
2 parents a9f2af9 + f1c81cc commit a9d8d96

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

addon/mixins/model.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,17 @@ export default Ember.Mixin.create({
6262

6363
if(!deletedRelations.get(relation)) {
6464
deletedRelations.set(relation, Ember.A());
65+
Ember.defineProperty(
66+
this,
67+
`manyToManyDeleted${relation}`, Ember.computed.readOnly(`_manyToManyDeleted.${relation}`)
68+
);
6569
}
6670

6771
if(!deletedRelations.get(relation).includes(model)) {
6872
deletedRelations.get(relation).pushObject(model);
6973
}
7074
},
7175

72-
manyToManyMarkedForDeletion(relation, model) {
73-
return this.get('_manyToManyDeleted') &&
74-
this.get(`_manyToManyDeleted.${relation}`) &&
75-
this.get(`_manyToManyDeleted.${relation}`).includes(model);
76-
},
77-
7876
manyToManyMarkedForDeletionModels(relation) {
7977
const relationModels = this.get('_manyToManyDeleted') &&
8078
this.get(`_manyToManyDeleted.${relation}`);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-data-jsonapi-extensions",
3-
"version": "0.5.6",
3+
"version": "0.5.7",
44
"description": "The default blueprint for ember-cli addons.",
55
"directories": {
66
"doc": "doc",

0 commit comments

Comments
 (0)