title: ActiveRecord DATETIME column values in mysql
body: <p>I am new to <code>ActiveRecord</code> and trying to do something fairly simple. I searched the internet and was unable to come up with a solution.</p>
  
  <p>In mysql I have a table column with a type of <code>DATETIME</code>. This table has many values in it already. Some example values for this column are <code>NULL</code>, <code>0000-00-00 00:00:00</code>, and <code>2009-04-30 10:30:22</code></p>
  
  <p>Using <code>rails</code> and <code>ActiveRecord</code> I can retrieve records from the database. However, when I ask for the value of a <code>DATETIME</code> field with the value of <code>0000-00-00 00:00:00</code> the result I get is a <code>nil</code> object.</p>
  
  <p>A database value of <code>NULL</code> also returns a <code>nil</code> object, which makes sense.</p>
  
  <p>A database value of <code>2009-04-30 10:30:22</code> returns <code>Thu, 30 Apr 2009 10:30:22 UTC +00:00</code> which also makes sense.</p>
  
  <p>I thought using <code>_before_type_cast</code> might help, but it does not.</p>
  
  <p>How can I determine if the object returned has a database value of <code>0000-00-00 00:00:00</code>?</p>