discourse/app/assets/javascripts/admin/models/version_check.js
2013-02-21 12:54:40 -05:00

25 lines
616 B
JavaScript

(function() {
window.Discourse.VersionCheck = Discourse.Model.extend({
hasInstalledSha: function() {
console.log( 'hello??' );
return( this.get('installed_sha') && this.get('installed_sha') != 'unknown' );
}.property('installed_sha')
});
Discourse.VersionCheck.reopenClass({
find: function() {
var promise = new RSVP.Promise()
jQuery.ajax({
url: '/admin/version_check',
dataType: 'json',
success: function(json) {
promise.resolve(Discourse.VersionCheck.create(json));
}
});
return promise;
}
});
}).call(this);