import Ember from 'ember';
import ajax from 'ic-ajax';

export default Ember.Route.extend({
  model() {
    function addCrates(store, crates) {
        for (var i = 0; i < crates.length; i++) {
            crates[i] = store.push(store.normalize('crate', crates[i]));
        }
    }

    return ajax('/summary').then((data) => {
        addCrates(this.store, data.new_crates);
        addCrates(this.store, data.most_downloaded);
        addCrates(this.store, data.just_updated);

        return data;
    });
  }
});

@@ -183,24 +183,222 @@
 gth; i++) %7B%0A
+            const crate = crates%5Bi%5D;%0A            if (crate.versions == null) %7B%0A              // passing %60null%60 will return an empty versions array%0A              delete crate.versions;%0A            %7D%0A
             
@@ -450,20 +450,16 @@
 ', crate
-s%5Bi%5D
 ));%0A    

Fix versions array bug