7327fc5e by Adam Heath

In defaultExpressionParser, remove the direct access to the model on the

first tokenized part of the key; use adapter.read instead.  This broke
all functional test cases, due to the adapter used therein having to
deal with both a normal object, and a Data object.
1 parent 6875475b
......@@ -15,12 +15,18 @@ describe('Functional', function() {
obj.on(keypath, callback);
},
read: function(obj, keypath) {
return obj.get(keypath);
if (obj instanceof Data) {
return obj.get(keypath);
}
return obj[keypath];
},
publish: function(obj, keypath, value) {
attributes = {};
attributes[keypath] = value;
obj.set(attributes);
if (obj instanceof Data) {
attributes = {};
attributes[keypath] = value;
obj.set(attributes);
}
obj[keypath] = value;
}
}
});
......
......@@ -182,7 +182,7 @@ defaultExpressionParser = (view, node, type, models, value) ->
bindContext: models
firstPart = splitPath.shift()
model = if firstPart
models[firstPart]
Rivets.config.adapter.read models, firstPart
else
models
keypath = splitPath.join '.'
......