This project is archived and is in readonly mode.
Dirty doesn't track integers changing from 0 to null
Reported by Tim Chater | June 17th, 2008 @ 09:16 AM | in 2.1.1
I've just noticed that when editing numeric fields, and changing the value from 0 to '', the alteration isn't saved. I think it's a bug in dirty...
>> l = Lookup.first
=> #<Lookup id: 1, field_name: "yn", option_number: 0, option_description: "No", created_by: 1, updated_by: 1, created_at: "2007-08-23 15:15:42", updated_at: "2007-08-23 15:15:42">
>> l.option_number = ''
=> ""
>> l.changed?
=> false
>> l.changes
=> {}
Comments and changes to this ticket
-
Tim Chater June 17th, 2008 @ 03:26 PM
- no changes were found...
-
Pratik June 27th, 2008 @ 04:14 PM
- Tag set to 2.1, activerecord, bug, dirty, patch, tested
- Assigned user set to Jeremy Kemper
-
Jeremy Kemper June 28th, 2008 @ 03:23 AM
- State changed from new to open
- Milestone set to 2.1.1
-
Repository June 28th, 2008 @ 05:34 AM
- State changed from open to resolved
(from [692e5954770bb3ed863e11463a7c09c7bbb422e9]) Dirty: recognize when an integer changes from zero to blank. [#433 state:resolved]
-
Repository June 28th, 2008 @ 05:35 AM
(from [1415df8f49a19d469b9e2c15785db32eb312c000]) Dirty: recognize when an integer changes from zero to blank. [#433 state:resolved]
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1518 Bug with dirty models in integer fields This was definitely a problem in 2.1.0 but #433/1415df8f4...