New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not inject include twice, expand and validate include in aggregate #5106
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? |
return item.as === scopeInclude.as; | ||
} else { | ||
var association = scopeInclude.association || self.getAssociation(scopeInclude.model, scopeInclude.as); | ||
return association ? item.as === association.as : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
$injectScope
to better checks existence of include inoptions.include
based 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