{ "id": "98101", "key": "ALOY-137", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14171", "description": "", "name": "2012 Sprint 19", "archived": true, "released": true, "releaseDate": "2012-09-24" }, { "id": "14176", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": false, "released": true, "releaseDate": "2012-12-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-19T23:27:42.000+0000", "created": "2012-07-26T12:16:56.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "20752", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "99425", "key": "ALOY-193", "fields": { "summary": "Discuss, test, and merge PR #55 on alloy repo", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-05-01T14:56:12.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "h2. problem\n\nI'd like to make the models actual JS and have them export configurations, as well as custom scripts. Right now having a {{model.json}} with the model config and then an optional extra {{model.js}} for a custom script feels a bit grafted together, and it's just more for a developer to need to keep track of. I'd rather have a single {{model.js}} file with all this information. And since we have the (model) generators at our disposal, I don't think this will be overwhelming for a developer to understand or use. \n\nh2. proposed solution\n\nThis is by no means final, but a generated model should probably look more like the below sample. Notes: \n* \"name\" and \"config\" would come from `alloy generate model`\n* migrations would be added at compile time, if necessary\n\n{code:javascript}\nvar Alloy = require('alloy');\nvar name = \"nameFromGenerate\";\nvar config = {\n\t\"columns\": {\n\t\t\"count\": \"Int\"\n\t},\n\t\"defaults\": {\n\t\t\"count\": 0\n\t},\n\t\"adapter\": {\n\t\t\"type\": \"properties\",\n\t\t\"prefix\": \"app\"\n\t}\n};\n\nvar Model = Alloy.M(name, config);\n\n///////////////////////////////////////////////////////\n///// INSERT CODE HERE TO EXTEND MODEL DEFINITION /////\n///////////////////////////////////////////////////////\n\nvar Collection = Alloy.Backbone.Collection.extend({model:Model});\nCollection.prototype.config = Model.prototype.config;\nexports.Model = Model;\nexports.Collection = Collection;\n{code}", "attachment": [], "flagged": false, "summary": "All \"model\" config and code should be contained in a single file", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "218444", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This should be resolved by ALOY-193. Update this ticket if it is not.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-11T14:52:23.000+0000", "updated": "2012-09-11T14:52:23.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }