{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/7755","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/7755/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/7755/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/7755/events","html_url":"https://github.com/sequelize/sequelize/issues/7755","id":234607656,"number":7755,"title":"No warnings when model named \"Model\" is defined","user":{"login":"dmlukichev","id":3776413,"avatar_url":"https://avatars0.githubusercontent.com/u/3776413?v=3","gravatar_id":"","url":"https://api.github.com/users/dmlukichev","html_url":"https://github.com/dmlukichev","followers_url":"https://api.github.com/users/dmlukichev/followers","following_url":"https://api.github.com/users/dmlukichev/following{/other_user}","gists_url":"https://api.github.com/users/dmlukichev/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlukichev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlukichev/subscriptions","organizations_url":"https://api.github.com/users/dmlukichev/orgs","repos_url":"https://api.github.com/users/dmlukichev/repos","events_url":"https://api.github.com/users/dmlukichev/events{/privacy}","received_events_url":"https://api.github.com/users/dmlukichev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-08T17:55:13Z","updated_at":"2017-06-12T19:15:58Z","closed_at":null,"body":"## What you are doing?\r\n\r\n```js\r\n/**\r\n *  Definition\r\n */\r\nconst Model = sequelize.define('Model', {\r\n    id: {\r\n        type: Sequelize.INTEGER,\r\n        primaryKey: true,\r\n        autoIncrement: true,\r\n    },\r\n    name: Sequelize.STRING(128),\r\n});\r\n\r\nconst SparePart = sequelize.define('SparePart', {\r\n    id: {\r\n        type: Sequelize.INTEGER,\r\n        primaryKey: true,\r\n        autoIncrement: true,\r\n    },\r\n    model_id: { \r\n        type: Sequelize.INTEGER, \r\n        allowNull: false, \r\n    },\r\n    sku: Sequelize.STRING(128),\r\n}, {\r\n    classMethods: {\r\n        associate() {\r\n            SparePart.belongsTo(Model);\r\n        }\r\n    }\r\n});\r\n```\r\n\r\n```js\r\n/**\r\n *  Usage\r\n */\r\nconst sku = 'abc';\r\nconst spart = SparePart.find({\r\n    where: { sku },\r\n    include: [ Model ]\r\n}) ;\r\n\r\nawait spart.update({ sku: 'some new sku' });\r\n```\r\n\r\n## What do you expect to happen?\r\nMy first expectation was `spart` to be saved properly.\r\nBut since inside 'save()' method Model means sequelize's Model, I get an error. \r\nSo 'Model' should be a reserved word.\r\nI think it would be nice to completely disallow defining model \"Model\". Or at least to warn a developer when he does this so he would be very carefull.\r\n\r\n__Dialect:__ mysql / postgres / sqlite / mssql / any\r\n__Database version:__ XXX\r\n__Sequelize version:__ 3"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/307891472","html_url":"https://github.com/sequelize/sequelize/issues/7755#issuecomment-307891472","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/7755","id":307891472,"user":{"login":"dmlukichev","id":3776413,"avatar_url":"https://avatars0.githubusercontent.com/u/3776413?v=3","gravatar_id":"","url":"https://api.github.com/users/dmlukichev","html_url":"https://github.com/dmlukichev","followers_url":"https://api.github.com/users/dmlukichev/followers","following_url":"https://api.github.com/users/dmlukichev/following{/other_user}","gists_url":"https://api.github.com/users/dmlukichev/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlukichev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlukichev/subscriptions","organizations_url":"https://api.github.com/users/dmlukichev/orgs","repos_url":"https://api.github.com/users/dmlukichev/repos","events_url":"https://api.github.com/users/dmlukichev/events{/privacy}","received_events_url":"https://api.github.com/users/dmlukichev/received_events","type":"User","site_admin":false},"created_at":"2017-06-12T19:15:58Z","updated_at":"2017-06-12T19:15:58Z","body":"In my example `spart` is not saved because sequelize throws error in the following lines:\r\nhttps://github.com/sequelize/sequelize/blob/v3/lib/instance.js#L531-L534"}}
{"actor":{"display_login":"dmlukichev"}}