discourse-data-explorer/assets/javascripts/discourse/models/query.js.es6

40 lines
755 B
Plaintext
Raw Normal View History

import RestModel from 'discourse/models/rest';
2015-06-30 13:20:22 -04:00
let Query;
Query = RestModel.extend({
dirty: false,
markDirty: function() {
this.set('dirty', true);
}.observes('name', 'description', 'sql', 'defaults'),
markNotDirty() {
this.set('dirty', false);
},
listName: function() {
if (this.get('dirty')) {
return this.get('name') + " (*)";
}
return this.get('name');
}.property('name', 'dirty'),
createProperties() {
return this.getProperties("name");
},
updateProperties() {
2015-06-30 13:20:22 -04:00
return this.getProperties(Query.updatePropertyNames);
},
run() {
console.log("Called query#run");
}
});
2015-06-30 13:20:22 -04:00
Query.reopenClass({
updatePropertyNames: ["name", "description", "sql", "defaults"]
});
export default Query;