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.6] syncOriginal on refresh #21889

Closed
wants to merge 1 commit into from
Closed

[5.6] syncOriginal on refresh #21889

wants to merge 1 commit into from

Conversation

patrickomeara
Copy link
Contributor

@patrickomeara patrickomeara commented Oct 31, 2017

Currently, after refreshing a model it can be dirty even when the attributes match those in the database.

$post = Post::create(['title' => 'pat']);

Post::find($post->id)->update(['title' => 'patrick']);

$post->refresh();

// current result
$post->getOriginal('title'); // pat
$post->getDirty(); // ['title' => 'patrick']

// with proposed fix 
$post->getOriginal('title'); // patrick
$post->getDirty(); // []

Syncing with the original after refresh prevents this.

@themsaid themsaid changed the title syncOriginal on refresh [5.5] syncOriginal on refresh Oct 31, 2017
@sisve
Copy link
Contributor

sisve commented Oct 31, 2017

And how can this change break existing 5.5 applications?

@taylorotwell
Copy link
Member

would be breaking.

@patrickomeara patrickomeara changed the base branch from 5.5 to master October 31, 2017 14:26
@patrickomeara patrickomeara changed the title [5.5] syncOriginal on refresh [5.6] syncOriginal on refresh Oct 31, 2017
@patrickomeara
Copy link
Contributor Author

patrickomeara commented Oct 31, 2017

Changed base to master and target to 5.6 to avoid breaking changes in 5.5

@deleugpn
Copy link
Contributor

Open a new PR

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.

4 participants