{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/2778","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/2778/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/2778/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/2778/events","html_url":"https://github.com/sequelize/sequelize/issues/2778","id":52845196,"number":2778,"title":"findOne fails if model contains attribute called length","user":{"login":"ebrian","id":4989650,"avatar_url":"https://avatars.githubusercontent.com/u/4989650?v=3","gravatar_id":"","url":"https://api.github.com/users/ebrian","html_url":"https://github.com/ebrian","followers_url":"https://api.github.com/users/ebrian/followers","following_url":"https://api.github.com/users/ebrian/following{/other_user}","gists_url":"https://api.github.com/users/ebrian/gists{/gist_id}","starred_url":"https://api.github.com/users/ebrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebrian/subscriptions","organizations_url":"https://api.github.com/users/ebrian/orgs","repos_url":"https://api.github.com/users/ebrian/repos","events_url":"https://api.github.com/users/ebrian/events{/privacy}","received_events_url":"https://api.github.com/users/ebrian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sequelize/sequelize/labels/bug","name":"bug","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-25T03:13:40Z","updated_at":"2015-01-04T12:20:00Z","closed_at":null,"body":"I'm executing some really simple logic that works in 2.0.0-rc2 but not in >= 2.0.0-rc3.\r\n\r\n```js\r\nmodels.mail_items\r\n    .findOne({\r\n\t    where : {\r\n\t        mail_item_id : 12\r\n\t    }\r\n    }).then(function(item) {\r\n\t    item.mail_package_id = 2;\r\n\r\n\t    return item.save();\r\n    });\r\n```\r\n\r\nIf I add\r\n\r\n```js\r\n.then(null, function(err) { console.log(err.stack); })\r\n```\r\n\r\nonto item.save();\r\n\r\nI get this stack:\r\n```\r\nRangeError: Invalid array length\r\n    at /media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/dialects/abstract/query-generator.js:298:34\r\n    at forOwn (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/node_modules/lodash/dist/lodash.js:2105:15)\r\n    at Function.forEach (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/node_modules/lodash/dist/lodash.js:3302:9)\r\n    at Object.module.exports.QueryGenerator.updateQuery (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/dialects/abstract/query-generator.js:297:17)\r\n    at module.exports.QueryInterface.update (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/query-interface.js:534:35)\r\n    at /media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/instance.js:601:43\r\nFrom previous event:\r\n    at /media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/instance.js:578:25\r\nFrom previous event:\r\n    at module.exports.Instance.save (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/instance.js:500:23)\r\n    at null.<anonymous> (/media/m/2-WorkingTrees/myrvmail-node/front/api/controllers/striker/MailController.js:232:42)\r\n    at Promise._settlePromiseAt (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/promise.js:66:18)\r\nFrom previous event:\r\n    at Function.Promise$Bind [as bind] (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:274:9)\r\n    at module.exports.Model.findAll (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/model.js:684:20)\r\n    at module.exports.Model.findOne (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/sequelize/lib/model.js:779:36)\r\n    at /media/m/2-WorkingTrees/myrvmail-node/front/api/controllers/striker/MailController.js:224:34\r\n    at _fulfilled (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/q/q.js:787:54)\r\n    at self.promiseDispatch.done (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/q/q.js:816:30)\r\n    at Promise.promise.promiseDispatch (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/q/q.js:749:13)\r\n    at /media/m/2-WorkingTrees/myrvmail-node/front/node_modules/q/q.js:509:49\r\n    at flush (/media/m/2-WorkingTrees/myrvmail-node/front/node_modules/q/q.js:108:17)\r\n```\r\n\r\nNot sure if it's a real issue or just me being dumb."},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/68630982","html_url":"https://github.com/sequelize/sequelize/issues/2778#issuecomment-68630982","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/2778","id":68630982,"user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T12:20:00Z","updated_at":"2015-01-04T12:20:00Z","body":"It appears there's a bug, because you should obviously be allowed to have an attribute named length."}}