6875475b by Adam Heath

In Binding.formattedValue, do not directly access the model; use

adapter.read instead.  This broke 1 test case.  Going forward,
adapter.read *must* do something sensible, at the least doing an
object[key].
1 parent 47c8859d
...@@ -6,7 +6,7 @@ describe('Rivets.Binding', function() { ...@@ -6,7 +6,7 @@ describe('Rivets.Binding', function() {
6 adapter: { 6 adapter: {
7 subscribe: function() {}, 7 subscribe: function() {},
8 unsubscribe: function() {}, 8 unsubscribe: function() {},
9 read: function() {}, 9 read: function(model, key) { return model[key]; },
10 publish: function() {} 10 publish: function() {}
11 } 11 }
12 }); 12 });
......
...@@ -41,8 +41,9 @@ class Rivets.Binding ...@@ -41,8 +41,9 @@ class Rivets.Binding
41 args = formatter.split /\s+/ 41 args = formatter.split /\s+/
42 id = args.shift() 42 id = args.shift()
43 43
44 formatter = if model[id] instanceof Function 44 m = Rivets.config.adapter.read model, id
45 model[id] 45 formatter = if m instanceof Function
46 m
46 else 47 else
47 Rivets.formatters[id] 48 Rivets.formatters[id]
48 49
......