[#57,backend,refactor][s]: create a recline.Backend.Base model which other backends inherit from.

* At the moment this added little other than a cleaner structure but will help with change for #57.
This commit is contained in:
Rufus Pollock
2012-04-01 10:49:22 +01:00
parent 3412962a35
commit 767f9a23d6
5 changed files with 42 additions and 30 deletions

View File

@@ -19,7 +19,7 @@ this.recline.Backend = this.recline.Backend || {};
// localhost:9200 with index twitter and type tweet it would be
//
// <pre>http://localhost:9200/twitter/tweet</pre>
my.ElasticSearch = Backbone.Model.extend({
my.ElasticSearch = my.Base.extend({
_getESUrl: function(dataset) {
var out = dataset.get('elasticsearch_url');
if (out) return out;
@@ -39,7 +39,7 @@ this.recline.Backend = this.recline.Backend || {};
dataType: 'jsonp'
});
var dfd = $.Deferred();
my.wrapInTimeout(jqxhr).done(function(schema) {
this._wrapInTimeout(jqxhr).done(function(schema) {
// only one top level key in ES = the type so we can ignore it
var key = _.keys(schema)[0];
var fieldData = _.map(schema[key].properties, function(dict, fieldName) {