Matt DeBergalis
2005-Jul-26 23:04 UTC
validates_presence_of interacts poorly with integer fields
#1309 <http://dev.rubyonrails.com/ticket/1309> changed validates_presence_of to use Object#blank? instead of Object#empty? . I guess that''s fine for strings, but was this intended to apply to integer fields as well? I have dozens of validations that check to make sure that some integer fields are present, and they all now fail when those fields are set to 0. The trac ticket doesn''t suggest there was any intent to affect non-string fields. Might I suggest that for non-strings, we revert to empty? in the validation? cheers, matt