title: RoR Search conditions comparing two columns
body: <p>What I basically want to do is the following:</p>
  
  <pre><code>a = Assignment.all(:conditions =&gt; { :end_date &lt; :start_date })
  </code></pre>
  
  <p>I only want to select those records on which the <code>end_date</code> is <i>before</i> the <code>start_date</code>.</p>
  
  <p>I actually don't want ending up writing a<br>
  <code>for each</code>, push to array if <code>end_date</code> is earlier than <code>start_date</code>.</p>
  
  <p>How can I achieve this in a pretty 'Railsy'-way?</p>
  
  <p>Thank you in advance.</p>
  
  <h3>Edit:</h3>
  
  <p>I think the problem is comparing the values of both columns. (Allmost) every query is comparing a cell-value to an input-value.<br>
  This is a shot in the dark, but maybe one in the right direction ?</p>
  
  <p>Haven't figured out a solution.</p>