[model,refator][s]: reintroduce summary on Record object deprecating recordSummary on Dataset.

* Reverses change in 1dadc1106b
* Record now has fields attribute passed down from Dataset. This is needed in order to support summary method and also makes sense -- as pointed out by @zephod
* Update examples
This commit is contained in:
Rufus Pollock
2012-07-09 01:28:01 +01:00
parent 8fbb0682b3
commit d599f75e85
5 changed files with 66 additions and 30 deletions

View File

@@ -247,6 +247,22 @@ test('_normalizeRecordsAndFields', function () {
});
});
// =================================
// Record
module("Model Record");
test('summary', function () {
var dataset = new recline.Model.Dataset({
records: [ {a: 1, b: 2} ]
});
var record = dataset.records.at(0);
var out = record.summary();
var exp = '<div class="recline-record-summary"><div class="a"><strong>a</strong>: 1</div><div class="b"><strong>b</strong>: 2</div></div>'
equal(out, exp);
});
// =================================
// Query