balanced/balanced-dashboard — pull request #439 by victorlin (2013-07-30 07:56:05+00:00)
Title: Fix #408 customer CSV export bug

I try to this the issue with minimum effort. I think it might need some refactory. I traced it and noticed that the download controller mixin sets `model` attribute to `Balanced.Download` object.

```
Balanced.DownloadControllerMixin = Ember.Mixin.create({
needs: ['marketplace'],

download_model: null,
show_download: false,

openDownload: function () {
var uri = this.getSearchUri();
var download = Balanced.Download.create({
uri: uri,
email_address: null
});
this.set('model', download); // <----- here it is
this.set('show_download', true);
},
```

I don't think it is a correct way to do, as it overwrites original model object of customer controller (and all other controllers), which might servers other purpose. When the `model` object is set by download controller mixin, some black magic happens behind the scene (I don't really like these magic behaviors, those Ember.Bind things, explicit is better than implicit :S). Eventually, the `transactions` attribute is updated in a wrong way, leads to updating view, that's why the transaction data disappears from the UI.

I set it as `download_model` instead of `model`

```
this.set('download_model', download);
```

This should work, however, I feel the download modal should be implemented as a view object instead of a controller mixin as all other modal views did.