Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1148] Update model template code to include Backbone 1.1.2 support code

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-10-24T15:21:41.000+0000
Affected Version/sAlloy 1.6.0
Fix Version/sAlloy 1.6.0
ComponentsSamples & Templates
Labelsn/a
ReporterTim Poulsen
AssigneeTim Poulsen
Created2014-09-26T14:17:01.000+0000
Updated2018-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);
}
*/

Comments

  1. Tim Poulsen 2014-09-26

    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.
  2. Feon Sua Xin Miao 2014-09-29

    PR merged.
  3. Tim Poulsen 2014-10-23

    Reopen to backport to 1_6_X branch
  4. Feon Sua Xin Miao 2014-10-24

    1_6_X: https://github.com/appcelerator/alloy/pull/602
  5. Tim Poulsen 2014-10-24

    PR merged
  6. Eric Wieber 2015-03-26

    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.

JSON Source