File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import Ember from 'ember' ;
2
2
3
+ const {
4
+ defineProperty,
5
+ computed
6
+ } = Ember ;
7
+
3
8
const resetRelations = function ( record ) {
4
9
Object . keys ( record . get ( '__recordsJustSaved' ) ) . forEach ( ( relationName ) => {
5
10
let relationRecords = record . get ( '__recordsJustSaved' ) [ relationName ] ;
@@ -62,19 +67,14 @@ export default Ember.Mixin.create({
62
67
63
68
if ( ! deletedRelations . get ( relation ) ) {
64
69
deletedRelations . set ( relation , Ember . A ( ) ) ;
70
+ defineProperty ( this , `manyToManyDeleted${ relation } ` , computed . readOnly ( `_manyToManyDeleted.${ relation } ` ) ) ;
65
71
}
66
72
67
73
if ( ! deletedRelations . get ( relation ) . includes ( model ) ) {
68
74
deletedRelations . get ( relation ) . pushObject ( model ) ;
69
75
}
70
76
} ,
71
77
72
- manyToManyMarkedForDeletion ( relation , model ) {
73
- return this . get ( '_manyToManyDeleted' ) &&
74
- this . get ( `_manyToManyDeleted.${ relation } ` ) &&
75
- this . get ( `_manyToManyDeleted.${ relation } ` ) . includes ( model ) ;
76
- } ,
77
-
78
78
manyToManyMarkedForDeletionModels ( relation ) {
79
79
const relationModels = this . get ( '_manyToManyDeleted' ) &&
80
80
this . get ( `_manyToManyDeleted.${ relation } ` ) ;
You can’t perform that action at this time.
0 commit comments