title: validates vs db check up in rails 3.1 for field presence
body: <p>In rails 3.1, we can validate presence of a field in model with:</p>
  
  <pre><code>validates :name, :presence =&gt; true
  </code></pre>
  
  <p>In db migration file, we also can do</p>
  
  <pre><code>t.string :name, :null =&gt; false
  </code></pre>
  
  <p>It seems that validates checks the data integrity before saving which is better. However db check up only happens during the saving process which may have started actual saving before aborting. Is validates in model better? Thanks so much.</p>