Skip to content

Instantly share code, notes, and snippets.

@bobey
Created January 31, 2013 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobey/4682095 to your computer and use it in GitHub Desktop.
Save bobey/4682095 to your computer and use it in GitHub Desktop.
App.TableAlias = DS.Model.extend({
name: DS.attr('string'),
alias: DS.attr('string'),
// ...
environment: null,
columns: [],
_loadColumns: function() {
var environment = this.get('environment');
if (!environment) {
// Si pas d'environnement sélectionné pas la peine de tenter de récupérer les colonnes...
return;
}
this.set('columns', App.Column.findByAlias(this, environment));
},
environmentDidChanged: function() {
this._loadColumns();
}.observes('environment'),
didLoad: function() {
this._loadColumns();
},
didUpdate: function() {
this._loadColumns();
}
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment