{"action":"created","comment":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/32726586","id":32726586,"diff_hunk":"@@ -4813,39 +4798,24 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {\n         describe('#remove', function() {\n           it('with no errors', function() {\n             var self = this\n-              , beforeProject = false\n-              , afterProject = false\n-              , beforeTask = false\n-              , afterTask = false;\n-\n-            this.Projects.beforeCreate(function(project, options, fn) {\n-              beforeProject = true;\n-              fn();\n-            });\n+              , beforeProject = sinon.spy()\n+              , afterProject = sinon.spy()\n+              , beforeTask = sinon.spy()\n+              , afterTask = sinon.spy();\n \n-            this.Projects.afterCreate(function(project, options, fn) {\n-              afterProject = true;\n-              fn();\n-            });\n-\n-            this.Tasks.beforeUpdate(function(task, options, fn) {\n-              beforeTask = true;\n-              fn();\n-            });\n-\n-            this.Tasks.afterUpdate(function(task, options, fn) {\n-              afterTask = true;\n-              fn();\n-            });\n+            this.Projects.beforeCreate(beforeProject);\n+            this.Projects.afterCreate(afterProject);\n+            this.Tasks.beforeUpdate(beforeTask);\n+            this.Tasks.afterUpdate(afterTask);\n \n             return this.Projects.create({title: 'New Project'}).then(function(project) {\n               return self.Tasks.create({title: 'New Task'}).then(function(task) {\n                 return project.addTask(task).then(function() {\n                   return project.removeTask(task).then(function() {\n-                    expect(beforeProject).to.be.true;\n-                    expect(afterProject).to.be.true;\n-                    expect(beforeTask).to.be.true;\n-                    expect(afterTask).to.be.true;\n+                    expect(beforeProject).to.have.been.called;\n+                    expect(afterProject).to.have.been.called;\n+                    expect(beforeTask).not.to.have.been.called;\n+                    expect(afterTask).not.to.have.been.called;","path":"test/integration/hooks.test.js","position":100,"original_position":100,"commit_id":"350980c827df87078f3c23265eb527f55c3f0519","original_commit_id":"350980c827df87078f3c23265eb527f55c3f0519","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},"body":"We might have @overlookmotel, but in any case i had forgotten about it when i wrote my few plugins and had to tell myself to use `individualHooks: true` in my code, but yeah that could be a way to go.","created_at":"2015-06-18T13:03:07Z","updated_at":"2015-06-18T13:03:07Z","html_url":"https://github.com/sequelize/sequelize/pull/3929#discussion_r32726586","pull_request_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3929","_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/32726586"},"html":{"href":"https://github.com/sequelize/sequelize/pull/3929#discussion_r32726586"},"pull_request":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3929"}}},"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/3929","id":37626615,"html_url":"https://github.com/sequelize/sequelize/pull/3929","diff_url":"https://github.com/sequelize/sequelize/pull/3929.diff","patch_url":"https://github.com/sequelize/sequelize/pull/3929.patch","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3929","number":3929,"state":"open","locked":false,"title":"Rewrite hasMany and belongsToMany","user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"body":"Originally I wanted to wait with this PR until https://github.com/sequelize/sequelize/pull/3745 but I though I'd rather throw it up here before it gets too behind with master. I even had to do a dirty merge because there we so many new commits to rebase on :(\r\n\r\nThis was sparked by my work on https://github.com/sequelize/sequelize/issues/3592. I've rewritten large parts of hasmany, to accomodate for the fact that we only support 1:n hasMany. I've also removed has-many-single-linked.js and integrated in into has-many\r\n\r\nI've changed belongs-to-many to work more directly on the join table - should make the code both faster and more readable.\r\n\r\nI've changed a couple of tests - see in comments","created_at":"2015-06-13T15:39:50Z","updated_at":"2015-06-18T13:03:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c599f84435e79cc76e9fdd70f7de2e202b4ce562","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3929/commits","review_comments_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3929/comments","review_comment_url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3929/comments","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/350980c827df87078f3c23265eb527f55c3f0519","head":{"label":"sequelize:rewriteAssoc","ref":"rewriteAssoc","sha":"350980c827df87078f3c23265eb527f55c3f0519","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","created_at":"2010-07-22T07:11:11Z","updated_at":"2015-06-18T04:57:33Z","pushed_at":"2015-06-17T21:20:39Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":57976,"stargazers_count":3958,"watchers_count":3958,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":882,"mirror_url":null,"open_issues_count":418,"forks":882,"open_issues":418,"watchers":3958,"default_branch":"master"}},"base":{"label":"sequelize:master","ref":"master","sha":"0cee002ab173aa83f0db7ee16571b9bcc9cc8f32","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","created_at":"2010-07-22T07:11:11Z","updated_at":"2015-06-18T04:57:33Z","pushed_at":"2015-06-17T21:20:39Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":57976,"stargazers_count":3958,"watchers_count":3958,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":882,"mirror_url":null,"open_issues_count":418,"forks":882,"open_issues":418,"watchers":3958,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3929"},"html":{"href":"https://github.com/sequelize/sequelize/pull/3929"},"issue":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/3929"},"comments":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/3929/comments"},"review_comments":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3929/comments"},"review_comment":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3929/commits"},"statuses":{"href":"https://api.github.com/repos/sequelize/sequelize/statuses/350980c827df87078f3c23265eb527f55c3f0519"}}}}