[#88,backend][s]: add __type__ attribute to all backends to identify them and provide a more robust and generic way to load backends from a string identifier such as that __type__ field.
* Also remove recline.Model.backends registry as can be replaced with this more generic solution. * This refactoring is necessitated by our need to serialize backend info for save/reload of a dataset and explorer state in #88.
This commit is contained in:
@@ -103,6 +103,16 @@ test('Dataset _prepareQuery', function () {
|
||||
deepEqual(out, exp);
|
||||
});
|
||||
|
||||
test('Dataset _backendFromString', function () {
|
||||
var dataset = new recline.Model.Dataset();
|
||||
|
||||
var out = dataset._backendFromString('recline.Backend.Memory');
|
||||
equal(out.__type__, 'memory');
|
||||
|
||||
var out = dataset._backendFromString('dataproxy');
|
||||
equal(out.__type__, 'dataproxy');
|
||||
});
|
||||
|
||||
|
||||
// =================================
|
||||
// Query
|
||||
|
||||
Reference in New Issue
Block a user