title: Rails greater_than model validation against model attribute
body: <p>I've got a Trip model, which among other attributes has a start_odometer and end_odometer value. 
  In my model, i'd like to validate that the end odometer is larger than the starting odometer.
  The end odometer can also be blank because the trip may not have finished yet.</p>
  
  <p>However, I can't figure out how to compare one attribute to another.</p>
  
  <p>In trip.rb:</p>
  
  <p>comparing against the symbol:</p>
  
  <pre><code>validates_numericality_of :end_odometer, :greater_than =&gt; :start_odometer, :allow_blank =&gt; true
  </code></pre>
  
  <p>gives me the error:</p>
  
  <blockquote>
    <p>ArgumentError in TripsController#index</p>
    
    <p>:greater_than must be a number</p>
  </blockquote>
  
  <p>comparing against the variable:</p>
  
  <pre><code>validates_numericality_of :end_odometer, :greater_than =&gt; start_odometer, :allow_blank =&gt; true
  </code></pre>
  
  <blockquote>
    <p>NameError in TripsController#index</p>
    
    <p>undefined local variable or method `start_odometer' for #</p>
  </blockquote>