[ALOY-1148] Update model template code to include Backbone 1.1.2 support code
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-10-24T15:21:41.000+0000 |
Affected Version/s | Alloy 1.6.0 |
Fix Version/s | Alloy 1.6.0 |
Components | Samples & Templates |
Labels | n/a |
Reporter | Tim Poulsen |
Assignee | Tim Poulsen |
Created | 2014-09-26T14:17:01.000+0000 |
Updated | 2018-01-04T23:29:45.000+0000 |
Description
Per ALOY-1074, if a developer uses Backbone 1.1.2 (rather than the default 0.9.2), he/she must extend the collection definition to account for a breaking change in backbone.
Add this to the modelcode.js template file to provide guidance to developers attempting to use this feature.
// For Backbone v1.1.2, uncomment this to override the fetch method
/*
fetch: function(options) {
options = options ? _.clone(options) : {};
options.reset = true;
return Backbone.Collection.prototype.fetch.call(this, options);
}
*/
PR https://github.com/appcelerator/alloy/pull/577 To test: In a new or existing Alloy project, from the project's directory, enter:
alloy generate model foo sql name:text
Then, open app/models/foo.js. The collection-extension function includes a comment, which if uncommented will extend collections to implement the former functionality.PR merged.
Reopen to backport to 1_6_X branch
1_6_X: https://github.com/appcelerator/alloy/pull/602
PR merged
Verified fixed using: Titanium SDK 4.0.0.v20150325201813 Studio 4.0.0.201503232213 Appc NPM: 0.3.35 Appc CLI 0.2.192 Alloy 1.6.0-alpha Commented 'backbone 1.1.2' section is correctly added.