Skip to content

Add support for scope in has-one association#5113

Merged
mickhansen merged 3 commits intosequelize:masterfrom
verdier:fix-scope
Dec 30, 2015
Merged

Add support for scope in has-one association#5113
mickhansen merged 3 commits intosequelize:masterfrom
verdier:fix-scope

Conversation

@verdier
Copy link
Contributor

@verdier verdier commented Dec 29, 2015

This PR fix two issues:

  • the association's scope was not injected in where clause when eager loaded. This is extremely critical because any raw that match without the where restriction is eager loaded, that could result in sending private data to the client (that's what append to us...),
  • the association's scope was not used is the creator helper method (ie. createInstance)

@mickhansen
Copy link
Contributor

hasOne never had scope support, soooo ;p
The two bugs you mention are actually just the fact that the implementation does not exist.

@verdier
Copy link
Contributor Author

verdier commented Dec 29, 2015

Haha @mickhansen that's fun... the implementation is here. Could you merge?

@mickhansen
Copy link
Contributor

Needs code and test for associationGetter aswell.

@verdier
Copy link
Contributor Author

verdier commented Dec 29, 2015

Ok I'll do that tomorrow

@mickhansen
Copy link
Contributor

Great, will merge then :)

@verdier verdier changed the title Fix has-one scope not injected in where clause (critical) and not used in creator Add support for scope in has-one association Dec 29, 2015
@verdier
Copy link
Contributor Author

verdier commented Dec 29, 2015

@mickhansen done. Ready to be merged.

mickhansen added a commit that referenced this pull request Dec 30, 2015
Add support for scope in has-one association
@mickhansen mickhansen merged commit e4b9567 into sequelize:master Dec 30, 2015
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.

2 participants