title: Get the model instance from within a lambda
body: <p>I have a nested form that, upon update, creates duplicate entries for all the nested attributes. In order to prevent this, I want to use the <code>reject_if</code> option for <code>accepts_nested_attributes</code>. The code might look something like this:</p>
  
  <pre><code>accepts_nested_attributes_for :implicants, :reject_if =&gt; lambda { |a| a.is_a_duplicate? }
  </code></pre>
  
  <p>Unfortunately, <code>a</code> here is an ActionController::Parameter, not the instance of the class I'm working with. I tried this:</p>
  
  <pre><code>accepts_nested_attributes_for :implicants, :reject_if =&gt; lambda { |a| self.is_a_duplicate?(a) }
  </code></pre>
  
  <p>But this results in a call to the class, as opposed to the instance. Is there any way refer to the instance from within a <code>reject_if</code> lambda?</p>