{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3456","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3456/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3456/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3456/events","html_url":"https://github.com/sequelize/sequelize/issues/3456","id":66257934,"number":3456,"title":"[question] Hooks on Sequelize","user":{"login":"sebay00","id":765118,"avatar_url":"https://avatars.githubusercontent.com/u/765118?v=3","gravatar_id":"","url":"https://api.github.com/users/sebay00","html_url":"https://github.com/sebay00","followers_url":"https://api.github.com/users/sebay00/followers","following_url":"https://api.github.com/users/sebay00/following{/other_user}","gists_url":"https://api.github.com/users/sebay00/gists{/gist_id}","starred_url":"https://api.github.com/users/sebay00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebay00/subscriptions","organizations_url":"https://api.github.com/users/sebay00/orgs","repos_url":"https://api.github.com/users/sebay00/repos","events_url":"https://api.github.com/users/sebay00/events{/privacy}","received_events_url":"https://api.github.com/users/sebay00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-04T00:52:27Z","updated_at":"2015-04-07T11:20:02Z","closed_at":"2015-04-06T12:57:51Z","body":"Hi there,\r\n\r\nI'm getting some troubles about Hooks. \r\nI've tried 2 hooks, afterUpdate and afterValidate.\r\n\r\nI have a hook declared on my user model : \r\n```\r\n  hooks: {\r\n    afterUpdate: someFunction\r\n  }\r\n\r\n// Later\r\n\r\nfunction someFunction(user, opts, next)\r\n{\r\n     //Handle new values of user\r\n}\r\n```\r\n\r\nThe function is never called on `User.update()`, whereas my model is updated.\r\n\r\nI tried with afterValidate too, and it seems to work better. At least it's called by the User.update().\r\nBut only changed attributes are reachables in the hook function.\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/90510280","html_url":"https://github.com/sequelize/sequelize/issues/3456#issuecomment-90510280","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3456","id":90510280,"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-04-07T11:20:02Z","updated_at":"2015-04-07T11:20:02Z","body":"Ah yes then the docs are indeed a bit outdated since we merged the options."}}