The problem is that Backbone >= 0.9.9 doesn't accept updating models with:
model.set(otherModel);
That needs to be changed to:
model.set(otherModel.attributes);
Dataset.query() accepts both regular JS objects and Query models, so we need to
check the parameter type to support both.
* The bug was triggered by change in 4d128af797546e5174537d8ed530a243e444eeab to use model fields if explicitly provided
* model.test.js illustrated issue (that new test was failing prior to changes to csv backend in this commit)
* Issue was that CSV backend did not pass back fields option. Previously, if no fields provided from backend we extracted fields from first row of the returned records. With change in 4d128af797546e5174537d8ed530a243e444eeab to use model fields if provided we had an issue as we no longer removed first row for fields.
* Fixed by having CSV backend explicitly extract fields and pass them back
If passed fields = [ null, ..., ...] or [ ... , null, ...] we fail in Dataset._normalizeRecordsAndFields method because:
1. If null is first element we do not do field generation correctly because typeof(null) is object - ede211646a/src/model.js (L108)
2. We call toString on field names which fails for null ede211646a/src/model.js (L113)
* view.graph.js improve graph view by making sure datetime for an axis is judged by whether it is date, datetime or time not just date!
* backend.ckan.js some type conversions now done in core model so can be removed
* Reverses change in 1dadc1106bd2dbcad4580d3889e15ac44c865f80
* 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
* Now have Dataset setup and manage "memory store"
* New fetch API as per issue #162 spec
* dataproxy utilizes useMemoryStore attribute and just implements fetch
* Switch gdocs to use Memory.Store properly via new useMemoryStore + fetch methodology
* Memory backend: query function now follows promise API, remove fetch,upsert,delete and add save function to Store object
* Also refactor to remove _source in QueryResult "hits" attribute on all backends but ElasticSearch - cf #159 (note this means ES currently broken)
* Layout is still not right -- need to put widget in sidebar (though looks a lot better)
* Datset.getFieldsSummary to compute facets for fields
* Remove facet usage in the demo
* 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.
* One nastiness along the way (30m delay!) that is worth noting: flot graph was a problem because it turned out that a) (re-)render triggered by dataset attributes change and fields only got set *after* core dataset attributes and so info was rendering.
* model.test.js: basic test for Dataset.toTemplateJSON
* tests: refactor Memory backend tests so that tests are independent (to avoid issues of carry over of query state)
* TODO: use query stuff in views - NB sorting seems broken in DataTable.
* Backbone.sync now switches on type of backend set for a dataset (allowing simultaneous use of multiple datasets with different backends)
* Datasets are initialized with backend config (see docs and code)