This project is archived and is in readonly mode.
[PATCH] Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value
Reported by ckozus | January 3rd, 2009 @ 07:35 PM | in 2.x
This currently works fine only for decimal fields. I've created a patch with test cases to fix the problem considering also decimal and float values.
Comments and changes to this ticket
-
ckozus January 3rd, 2009 @ 07:36 PM
- Tag set to activerecord, bug, edge, patch
- Title changed from Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value to [PATCH] Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value
-
Frederick Cheung January 4th, 2009 @ 01:48 PM
Seems reasonable to me, however I suggest that you change the condition to ready
column.number?
rather than
[:integer, :decimal, :float].include?(column.type)
-
ckozus January 4th, 2009 @ 10:24 PM
Thanks for the tip Frederick! I wasn't aware of the number? method.
I'm attaching a simpler patch.
-
Repository January 15th, 2009 @ 09:12 PM
- State changed from new to committed
(from [9606bc883292102faaff0e3046855521d36131ef]) Fixing bug on ActiveRecord::Dirty#field_changed? for nullable numeric columns, NULL gets stored in database for blank (i.e. '') values. Only integer columns were considered.
Signed-off-by: Michael Koziarski michael@koziarski.com [#1692 state:committed] http://github.com/rails/rails/co...
-
Repository January 15th, 2009 @ 09:12 PM
(from [c891d685de9a729332836751c1293770b86a1b52]) Fixing bug on ActiveRecord::Dirty#field_changed? for nullable numeric columns, NULL gets stored in database for blank (i.e. '') values. Only integer columns were considered.
Signed-off-by: Michael Koziarski michael@koziarski.com [#1692 state:committed] http://github.com/rails/rails/co...
-
Repository January 16th, 2009 @ 05:40 PM
- State changed from committed to resolved
(from [5ed119c005864b586a259e9d8def5f7aef8a4e54]) Fix dirty handling of nullable non-integer numeric columns [#1692 state:resolved]
Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...
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
Tags
Referenced by
- 1754 Setting a decimal from 0.0 to '' doesn't constitute a change duplicate of #1692
- 1692 [PATCH] Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value Signed-off-by: Michael Koziarski michael@koziarski.com [#...
- 1692 [PATCH] Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value Signed-off-by: Michael Koziarski michael@koziarski.com [#...
- 1692 [PATCH] Dirty objects shouldn't track changes when a nullable numeric field is assigned a blank value (from [5ed119c005864b586a259e9d8def5f7aef8a4e54]) Fix dir...