title: Dynamic form validation in Rails
body: <p>I have a form which I want to validate. The validation is based on properties in a couple of other model objects, but the form itself does not correspond to a ActiveRecord model.</p>
  
  <p>Would it be possible to use ActiveModel to achieve this?</p>
  
  <pre><code>class Person &lt; ActiveModel
    has_one :shoe
    validates :name, :length =&gt; { :maximum =&gt; self.shoe.size }
  end
  </code></pre>
  
  <p>I basically want to validate a form based on the properties of another model object. Is this possible in anyway?</p>