title: Remove default_scope in association
body: <p>I have a model using Paranioa gem ( <a href="https://github.com/radar/paranoia" rel="nofollow">https://github.com/radar/paranoia</a> ) for keeping deleted ActiveRecord elements in database. Paranioa uses a <code>deleted_at</code> column ; when this column is <code>NULL</code>, the object is not deleted. It works using a default scope, like this :</p>
  
  <pre><code>default_scope { where(:deleted_at =&gt; nil) }
  </code></pre>
  
  <p>My problem is that I want to get all the elements (including deleted ones) in a scope :</p>
  
  <pre><code>class MyOtherModel &lt; ActiveRecord::Base
     has_many :paranoia_models
  end
  </code></pre>
  
  <p>This declaration generates queries like this :</p>
  
  <pre><code>SELECT * FROM `paranioa_models` WHERE `paranioa_models`.`deleted_at` IS NULL AND ...
  </code></pre>
  
  <p>It's easy to get all my elements (including deleted ones) with a function like this</p>
  
  <pre><code>def paranioa_models_with_deleted
    return self.paranioa_models.with_deleted
  end
  </code></pre>
  
  <p>The <code>with_deleted</code> unscope default scope.</p>
  
  <p>My question is: How can I unscope this default_scope in the scope of MyOtherModel, directly in the <code>:has_many</code> scope ?</p>
  
  <p>Your solutions :</p>
  
  <ul>
  <li><code>has_many :paranoia_models, -&gt; { unscoped }</code> returns only non-deleteds</li>
  <li><code>self.paranoia_models.unscoped</code> returns ALL the ParanoiaModels (including ParanoiaModel belonging to others)</li>
  </ul>