[Rails] Re: how to determine if a database column has been set?

2008-11-14 Thread Perry Smith
Also, if you are interested. NULL values in database tables, by the super DB guys like Date and Pascal, are frowned upon. They create "three way logic" which often yields unexpected results and is not part of boolean algebra and is outside of the theory that relational DB is based upon. The

[Rails] Re: how to determine if a database column has been set?

2008-11-14 Thread Perry Smith
The database query that you want is foo.odometer IS NULL (for when it has not been set) or IS NOT NULL (for when it has ben set). You could google ActiveRecord and "IS NULL" and see if you find hits. I *think* the code does this correctly. e.g. Table.find(:all, :conditions => { :odomiter =>