-
Notifications
You must be signed in to change notification settings - Fork 349
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
Boolean always get an entry in history... #16
Comments
Hmmm interesting, if there's any issues in determining which fields have been updated and which are unchanged, it points to a possible bug in In particular, the following line is equating to true:
Since the As a test, perhaps do a |
Yep...that is the problem. http://paste.laravel.com/wEV Looks like it's being cast to an integer where when it's in the database it is a string. I just confirmed that the disabled field is a boolean in the migration Not sure if you typo'd it or not, but in my version of Laravel that line is: |
I copied that line from the Laravel project in it's latest form on github. Might be worth opening an issue in Laravel to confirm that it is correct behaviour... if they feel that booleans should continue to be cast to an int when pulled from the database, then we'll have to adhere to that and make a fix to cater for it. |
Oh actually... my apologies, the latest Laravel has Seems it was updated in Laravel about a month back laravel/framework@e247073 |
Found the fix here after asking in IRC. :P |
Awesome, nice find. If enough other people have this issue, then we'll look at putting this in revisionable core |
I can't seem to get this to work, unfortunately. Even when I have the getAttribute in my base model, it never gets called on my boolean fields if they are changing. Any ideas? I think I'm in need of tutoring... 😄 |
If I submit a form with a single string change on it, no matter what the boolean field value is set to (even if it's the same), I always gets an entry in the revisions table. See below. Am I just doing something wrong, or did I stumble across a bug? At first I thought it was a false vs. 0 issue, but even when I change the value to 0 when setting the boolean flag, I still see the result in the database as below. Thanks!!
The text was updated successfully, but these errors were encountered: