Hi,

How do you validate booleans? Normally, I validate them through

  validates_inclusion_of :is_root, :in => [false, true]

But when I test the :is_root attribute against a string, it passes. Here 
are some examples:

passes my test => [0, 1, true, false] (they should pass right?)
don't pass => [nil, '', ' '] (they shouldn't pass, so test is still ok)

passes my test => ['this is not valid' ,-1, 1.30 ,2, 10], but they 
shouldn't. Am I overlooking something, or is there still a bug in Rails 
2.3 RC2?
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to