Skip to content

Fixes setAssociation with scope - #7159

Merged
janmeier merged 2 commits into
sequelize:masterfrom
pola88:fixes_belongs_to_many_scope
Feb 8, 2017
Merged

janmeier merged 2 commits into
sequelize:masterfrom
pola88:fixes_belongs_to_many_scope

Conversation

@pola88

@pola88 pola88 commented Jan 27, 2017

Copy link
Copy Markdown
Contributor

fixing: #7153

@codecov-io

codecov-io commented Jan 27, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #7159 into master will increase coverage by <.01%.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e22ce18...6156a81. Read the comment docs.

@janmeier janmeier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, just some style comments

}).bind({}).spread(function(post, comment) {
this.post = post;
this.comment = comment;
return Tag.create({ name: 'tag1' });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be created together with the post and comment

return Tag.create({ name: 'tag1' });
}).then(function(tag) {
this.tag = tag;
return this.post.setTags([tag]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise.join(post.setTags, comment.setTags)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do it like that, I can't reproduce the issue, I need to add the tag to the post and then, add it to the comment.

taggable: {
type: DataTypes.STRING,
},
taggable_id: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funky indentation in the mode defintions

@janmeier janmeier self-assigned this Jan 30, 2017
@pola88

pola88 commented Jan 30, 2017

Copy link
Copy Markdown
Contributor Author

@janmeier I did the changes that you suggested to.

@pola88

pola88 commented Feb 1, 2017

Copy link
Copy Markdown
Contributor Author

@janmeier Do you know when are you going to release this fix?

janmeier pushed a commit that referenced this pull request Feb 1, 2017
…7159 (#7165)

* Fixes creation of polymorphic belongToMany associations in one step

* Fix test failure for MSSQL

* Fix tests
nadrane pushed a commit to nadrane/sequelize that referenced this pull request Feb 2, 2017
@elasticsearcher

Copy link
Copy Markdown
Contributor

@pola88 Hey, do you want to remerge master and re-run the tests? One of the test failures is transient whereas the other was probably fixed in master.

This is an important fix for scopes.

@pola88
pola88 force-pushed the fixes_belongs_to_many_scope branch from f99f044 to 6156a81 Compare February 7, 2017 19:26
@pola88

pola88 commented Feb 7, 2017

Copy link
Copy Markdown
Contributor Author

@elasticsearcher I merged master, We need to wait for @janmeier

@elasticsearcher

Copy link
Copy Markdown
Contributor

@pola88 Perfect, hopefully there won't be transient failures this time and this can be merged quickly as it's a small change.

Also, if you want the fix to become available in a v3 release, you'll also need to do a separate pull request for the v3 branch. That's what @janmeier told me last time.

@pola88

pola88 commented Feb 7, 2017

Copy link
Copy Markdown
Contributor Author

ok! good to know, I will do it later

@pola88

pola88 commented Feb 7, 2017

Copy link
Copy Markdown
Contributor Author

@elasticsearcher I created the PR for v3, if you need it #7223

@elasticsearcher

Copy link
Copy Markdown
Contributor

@pola88 Nice, hopefully it will make into a release soon.

@janmeier
janmeier merged commit 8cbd375 into sequelize:master Feb 8, 2017
mkaufmaner pushed a commit to mkaufmaner/sequelize that referenced this pull request Apr 25, 2017
…equelize#7159 (sequelize#7165)

* Fixes creation of polymorphic belongToMany associations in one step

* Fix test failure for MSSQL

* Fix tests
mkaufmaner pushed a commit to mkaufmaner/sequelize that referenced this pull request Apr 25, 2017
* Fixes setAssociation with scope

* Fixes style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants