File tree 2 files changed +14
-6
lines changed
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,7 @@ export default Ember.Route.extend({
5
5
model ( ) {
6
6
function addCrates ( store , crates ) {
7
7
for ( var i = 0 ; i < crates . length ; i ++ ) {
8
- const crate = crates [ i ] ;
9
- if ( crate . versions == null ) {
10
- // passing `null` will return an empty versions array
11
- delete crate . versions ;
12
- }
13
- crates [ i ] = store . push ( store . normalize ( 'crate' , crate ) ) ;
8
+ crates [ i ] = store . push ( store . normalize ( 'crate' , crates [ i ] ) ) ;
14
9
}
15
10
}
16
11
Original file line number Diff line number Diff line change
1
+ import DS from 'ember-data' ;
2
+
3
+ export default DS . RESTSerializer . extend ( {
4
+ isNewSerializerAPI : true ,
5
+
6
+ extractRelationships ( modelClass , resourceHash ) {
7
+ if ( resourceHash . versions == null ) {
8
+ delete resourceHash . versions ;
9
+ }
10
+
11
+ return this . _super ( modelClass , resourceHash ) ;
12
+ }
13
+ } ) ;
You can’t perform that action at this time.
0 commit comments