Rails is smarter than you (or, at least me)
I'm going back through the Rails tutorial that I mentioned last post, only using PostgreSQL 8.0.0 instead of MySQL this time, and discovered something very, very nice about Rails.
The tutorial (for those of you who haven't gone through itand if you haven't, you should; it won't take long, and I can waithas you create a database table for storing items on a todo list. There's a column called "done" of type integer; 1 means "done" and 0 means "not done". My first time through the tutorial I followed these directions, but this time I made the "done" column of type boolean because, well, it makes more sense and PostgreSQL has that data type.
Before, Rails presented the edit field for the "done" value as a text field. This time, with a boolean behind it, Rails presented it as a select list from which "True" or "False" can be chosen. In other words, Rails is smart enough not only to detect the table columns for itself, it's smart enough to realize that the possible values are constrained and change the default UI to something more appropriate.
Now, one could argue that for a boolean not null column, the UI element should really be a checkbox, but that would be nitpicking.