Skip to content

Add some code to stop scopes from being applied twice. #358

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

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

saernz
Copy link
Contributor

@saernz saernz commented Jul 2, 2020

This should fix #289 by overriding the builders implementation of applyScopes() to make it check if scopes have been applied already before attempting to apply them again.

@mikebronner
Copy link
Owner

@saernz Thanks so much for this, this is awesome! I will take a look first thing in the morning.

@mikebronner mikebronner merged commit 4389592 into mikebronner:master Jul 2, 2020
*/
public function applyScopes()
{
if ($this->scopesAreApplied) {
Copy link
Owner

@mikebronner mikebronner Jul 2, 2020

Choose a reason for hiding this comment

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

@saernz Quick question: where is $this->scopesAreApplied defined or updated when scopes are applied? I couldn't find it when doing a global search.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh, nevermind, I found it in Caching.php ... sorry, overlooked that earlier.

@saernz
Copy link
Contributor Author

saernz commented Jul 2, 2020

@mikebronner Thanks for the merge man! That's weird there was that compatibility issue that the tests didn't pick up, thanks for fixing it all up.

@mikebronner
Copy link
Owner

I think it was because the tests weren't triggering the case where the scopes weren't applied yet. Will experiment with that a bit and see if we can't get a test to do that.

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.

Scopes being applied twice
2 participants