{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3179","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3179/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3179/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3179/events","html_url":"https://github.com/sequelize/sequelize/issues/3179","id":58347673,"number":3179,"title":"addHook doesn't add hook if hook of same type already added as part of Model definition","user":{"login":"shaunerikson","id":8966548,"avatar_url":"https://avatars.githubusercontent.com/u/8966548?v=3","gravatar_id":"","url":"https://api.github.com/users/shaunerikson","html_url":"https://github.com/shaunerikson","followers_url":"https://api.github.com/users/shaunerikson/followers","following_url":"https://api.github.com/users/shaunerikson/following{/other_user}","gists_url":"https://api.github.com/users/shaunerikson/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunerikson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunerikson/subscriptions","organizations_url":"https://api.github.com/users/shaunerikson/orgs","repos_url":"https://api.github.com/users/shaunerikson/repos","events_url":"https://api.github.com/users/shaunerikson/events{/privacy}","received_events_url":"https://api.github.com/users/shaunerikson/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":2,"created_at":"2015-02-20T12:46:12Z","updated_at":"2015-02-24T14:44:10Z","closed_at":null,"body":"Using version 2.0.0-rc8\r\n\r\n```javascript\r\ndescribe('#addHook', function() {\r\n\r\n\tdescribe('hook of same type already added as part of Model definition', function() {\r\n\r\n\t\tit('should add additinoal hook (BUT DOES NOT - BUG?)', function(done) {\r\n\t\t\tvar hook1 = sinon.spy();\r\n\t\t\tvar hook2 = sinon.spy();\r\n\t\t\tvar Model = sequelize.define('Model', { \r\n\t\t\t\tname: Sequelize.STRING \r\n\t\t\t}, {\r\n\t\t\t\thooks: { beforeCreate: hook1 }\r\n\t\t\t});\r\n\t\t\tModel.addHook('beforeCreate', hook2);\r\n\t\t\tModel.sync({ force: true })\r\n\t\t\t\t.then(function() { return Model.create({ name: 'bob' }); })\r\n\t\t\t\t.then(function() {\r\n\t\t\t\t\thook1.should.have.been.calledOnce;\r\n\t\t\t\t\t// This assertion fails\r\n\t\t\t\t\thook2.should.have.been.calledOnce;\r\n\t\t\t\t\tdone(); \r\n\t\t\t\t})\r\n\t\t\t\t.catch(done);\r\n\t\t})\r\n\t});\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/75768546","html_url":"https://github.com/sequelize/sequelize/issues/3179#issuecomment-75768546","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3179","id":75768546,"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-02-24T14:44:10Z","updated_at":"2015-02-24T14:44:10Z","body":"Appears it's because the syntax is actually `beforeCreate: [hook1]`, where did you find the syntax you are using?"}}