{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/6166","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/6166/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/6166/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/6166/events","html_url":"https://github.com/sequelize/sequelize/pull/6166","id":161878023,"number":6166,"title":"belongs-to-many setters will respect through scope","user":{"login":"AlbinTheander","id":154710,"avatar_url":"https://avatars.githubusercontent.com/u/154710?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbinTheander","html_url":"https://github.com/AlbinTheander","followers_url":"https://api.github.com/users/AlbinTheander/followers","following_url":"https://api.github.com/users/AlbinTheander/following{/other_user}","gists_url":"https://api.github.com/users/AlbinTheander/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbinTheander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbinTheander/subscriptions","organizations_url":"https://api.github.com/users/AlbinTheander/orgs","repos_url":"https://api.github.com/users/AlbinTheander/repos","events_url":"https://api.github.com/users/AlbinTheander/events{/privacy}","received_events_url":"https://api.github.com/users/AlbinTheander/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-23T09:27:55Z","updated_at":"2016-06-23T09:47:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/6166","html_url":"https://github.com/sequelize/sequelize/pull/6166","diff_url":"https://github.com/sequelize/sequelize/pull/6166.diff","patch_url":"https://github.com/sequelize/sequelize/pull/6166.patch"},"body":"### Pull Request check-list\r\n\r\nI'll go through this list if the basic functionality of this change is wanted.\r\n\r\n- [ ] Does `npm run test` or `npm run test-DIALECT` pass with this change (including linting)?\r\n- [ ] Does your issue contain a link to existing issue (Closes #[issue]) or a description of the issue you are solving?\r\n- [ ] Have you added new tests to prevent regressions?\r\n- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?\r\n- [ ] Have you added an entry under `Future` in the changelog?\r\n\r\n_NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open._\r\n\r\n### Description of change\r\n\r\nThis change modifies the generated set<Assoications> functions for Belong-To-Many relations with a through scope. It adds the through scope to the first select query to avoid removing rows that are outside of the scope.\r\n\r\nWithout this fix, it's not possible to use setAssociations when having several Belongs-To-Many relationships that only differs in scope.\r\n\r\nIf this sounds like a good idea, I'll try to add the tests for it as well.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/228001905","html_url":"https://github.com/sequelize/sequelize/pull/6166#issuecomment-228001905","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/6166","id":228001905,"user":{"login":"AlbinTheander","id":154710,"avatar_url":"https://avatars.githubusercontent.com/u/154710?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbinTheander","html_url":"https://github.com/AlbinTheander","followers_url":"https://api.github.com/users/AlbinTheander/followers","following_url":"https://api.github.com/users/AlbinTheander/following{/other_user}","gists_url":"https://api.github.com/users/AlbinTheander/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbinTheander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbinTheander/subscriptions","organizations_url":"https://api.github.com/users/AlbinTheander/orgs","repos_url":"https://api.github.com/users/AlbinTheander/repos","events_url":"https://api.github.com/users/AlbinTheander/events{/privacy}","received_events_url":"https://api.github.com/users/AlbinTheander/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T09:47:37Z","updated_at":"2016-06-23T09:47:37Z","body":"Should I create an issue as well, for book-keeping purposes?"}}
{"actor":{"display_login":"AlbinTheander"}}