This project is archived and is in readonly mode.

#433 ✓resolved
Tim Chater

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

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>

Attachments

Referenced by

Pages