Skip to content
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

[5.4] Prevent applying global scopes on the factory while setting connection #19258

Merged
merged 1 commit into from
May 18, 2017
Merged

[5.4] Prevent applying global scopes on the factory while setting connection #19258

merged 1 commit into from
May 18, 2017

Conversation

themsaid
Copy link
Member

With the changes in #18846, we use:

$model->setConnection($model->query()->getConnection()->getName());

Using $model->query() applies the global scopes to the query which caused the problem reported in #19254

@JosephSilber
Copy link
Member

Isn't it a bug that they weren't applying global scopes before?

@taylorotwell taylorotwell merged commit 0ff3938 into laravel:5.4 May 18, 2017
@taylorotwell
Copy link
Member

@JosephSilber it doesn't seem like we would want to run global scopes just to get the connection name?

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.

3 participants