This project is archived and is in readonly mode.

#860 ✓resolved
Josh Susser

coerce blank strings to nil values for boolean and integer fields

Reported by Josh Susser | August 19th, 2008 @ 07:53 PM

This patch fixes ActiveRecord to consistently coerce blank strings to nil values for boolean and integer fields. Prior to this change, blank strings were coerced to false for booleans, while integer fields coerced empty strings to nil and non-empty blank strings (i.e. containing whitespace) to 0.

Apparently there's a bit of controversy over this functionality. Please see this thread: http://groups.google.com/group/r...

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>

Referenced by

Pages