Skip to content

Commit 8f6390c

Browse files
committed
Fix assertion error in Ember for version downloads
When running locally, I get the following error on a crates page, and no download graph gets rendered. > Assertion Failed: You must include an 'id' for version-download in an > object passed to 'push' This has been happening since 3c92ca2 landed. The fix involves telling Ember how to create a unique ID for a version-download object, using the composite key.
1 parent cfe6e08 commit 8f6390c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/serializers/version-download.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import DS from 'ember-data';
2+
3+
export default DS.RESTSerializer.extend({
4+
extractId(modelClass, resourceHash) {
5+
return `${resourceHash.date}-${resourceHash.version}`;
6+
},
7+
});

0 commit comments

Comments
 (0)