import Ember from 'ember';

export default Ember.Service.extend({
  store: Ember.inject.service(),
  feedModel: null,
  createOrFindFeedModel: function() {
    if (this.get('feedModel') == null) {
      var newFeedModel = this.get('store').createRecord('feed', { });
      this.set('feedModel', newFeedModel);
    }
    return this.get('feedModel');
  },
  downloadGtfsArchiveAndParseIntoFeedModel: function() {
    return true;
  }
});

@@ -413,20 +413,537 @@
     
-return true;
+var feedModel = this.createOrFindFeedModel();%0A    // var url = 'http://www.caltrain.com/Assets/GTFS/caltrain/GTFS-Caltrain-Devs.zip';%0A    var url = feedModel.get('url');%0A    var adapter = this.get('store').adapterFor('fetch_info');%0A    var fetch_info_url = adapter.urlPrefix()+'/fetch_info';%0A    var promise = adapter.ajax(fetch_info_url, 'post', %7Bdata:%7Burl:url%7D%7D);%0A    promise.then(function(response) %7B%0A      response.operators.map(function(operator)%7B%0A        feedModel.addOperator(operator)%0A      %7D);%0A    %7D);%0A    return promise
 %0A  %7D

Call remote 'fetch_info' on feed, return promise