Do not inject include twice, expand and validate include in aggregate#5106
Do not inject include twice, expand and validate include in aggregate#5106mickhansen merged 4 commits intosequelize:masterfrom verdier:master
Conversation
|
@mickhansen could you review my pull request? |
|
Applying the same scope twice should ideally not fail. |
|
You are right @mickhansen applying scope twice should be neutral. I'll have a look. |
|
@mickhansen I have found the problem, If To do that, I have made |
|
@mickhansen every thing is green. I think it's ready to be merged. |
|
Gonna need @janmeier to take a look on this one. |
|
@janmeier @sushantdhiman this PR fix #4986 (like #5090) but is a better solution, because it check equality based on the related association. Compared to this one, #5090 can result in false equality. If @janmeier could you review? |
There was a problem hiding this comment.
@janmeier the new logic is here, every thing else is to have self available.
|
Preferred having it as a non-prototype method but @janmeier will have to review and decide. |
|
Ok, waiting for @janmeier then |
|
Reverted @mickhansen |
|
The only job of |
|
|
|
Yep, but the used scope is alway set as |
|
It's true that the current use of the method is like that. However i'm sure that the intention was for it work for arbitrary scopes and options. But @janmeier will have to say since he wrote it. |
|
I suspect that just was for testing purpose, but waiting for @janmeier. |
|
I guess it was for testing purposes - I agree with @verdier that if you ever try to inject other than |
|
Just needs a couple of changelog entries, then this should be good to go |
|
@mickhansen could you add the changelog entries? |
|
@verdier You might aswell since this needs a squash aswell, just add a notice about fixing the issue at hand here and reference the PR/issues |
|
No problem, I will do that tomorrow. I was thinking that's you who keep the You want me to squash the test commits? Le lun. 4 janv. 2016 17:54, Mick Hansen notifications@github.com a écrit :
|
|
Squashed and changelog added @mickhansen. |
Do not inject include twice, expand and validate include in aggregate
|
Thanks @verdier |
Refactor
$injectScopeto better checks existence of include inoptions.includebased on the relatedassociation. This PR also fix a bug where include are not validated/expanded inmodel.aggregate.Fix #4986
Fix #5121
Fix
Cannot read property 'association' of undefined