Skip to content

When comparing new value to original, take type into account #1509

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

Closed
wants to merge 1 commit into from

Conversation

katiecrane
Copy link

This function is called from getDirty() to determine if a field on a model has been updated. When comparing dates, the types still need to be checked. You may be trying to replace the string “1994-04-01 00:00:00” with a date value of 1994-04-01 00:00:00, and for these two values, comparison with == is true while === is false. If we use ==, the value in the database will remain a string instead of updating to a date as we are trying to do.

@halaei
Copy link
Contributor

halaei commented Nov 30, 2018

Hi. In case you are still interested, please check #1664 which uses fromPHP() function for getDirty().

@divine
Copy link
Contributor

divine commented Jan 22, 2020

Should be closed in favor of PR #1664

cc @Smolevich

@Smolevich Smolevich closed this Jan 22, 2020
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