title: Validating models against the parent model
body: <p>I have two models, one is the parent of the other, and the parent accepts_nested_attributes_for and validates_associated the children.</p>
  
  <p>However, some of my validations have an :if that needs to check one of the properties of the parent.</p>
  
  <p>I was thinking that I could do something like this:</p>
  
  <pre><code>validates_presence_of :blah, :if =&gt; Proc.new{|thing| thing.parent.some_value.present?}
  </code></pre>
  
  <p>However, the 'parent' relationship doesn't appear to be setup at the time of validation (I would assume the children get instantiated and validated first.</p>
  
  <p>Therefore is there any way of doing what I'm thinking of? Is it possible?</p>