Jim Burgess wrote:
> Thanks for your reply
> 
>> Looks like a case for allow_nil:
>> 
>> validates_numericality_of :children, :allow_nil => true
> 
> I created the field 'children' as a string (can't remember why, perhaps 
> because someone might enter 'none'??), so that doesn't work.
> 
> Is there any big advantage to changing the field 'children' into an 
> interger?

Well, if the column  will hold numbers sure there is an advantage. You 
can perform arithmetic and numeric comparisons. You can sort based on 
the natural order of numbers, not based on lexicographical order.


Stephan

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to