Mike Chai wrote:
> I'm a little confused as to how booleans work in Rails. Which is
> better in the database? boolean or int(1)? True == 1 and False == 0,
> right? Using SQLite, I tried to set a value to true inside the
> database but it gave me an error. MySql didn't, so I had to switch to
> int(1) for it to work. Is this just how it is?

No.  True == anything other than nil or false
    False == False

DBMS have their own specific ways of handling booleans.  The DBMS 
adapter handles converting that to a Ruby form.
-- 
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