title: Rails 3 validate uniqueness ignores default scope on model
body: <p>I'm using the permanent_records gem in my rails 3.0.10 app, to prevent hard deletes and it seems rails is ignoring my default scope in checking uniqueness</p>
  
  <pre><code># user.rb
  class User &lt; AR::Base
    default_scope where(:deleted_at =&gt; nil)
  
    validates_uniqueness_of :email # done by devise
  end
  </code></pre>
  
  <p>in my rails console trying to find a user by email that has been deleted results in null, but when signing up for a new account with a deleted email address results in a validation error on the email field.</p>
  
  <p>This is also the case for another model in my app</p>
  
  <pre><code># group.rb
  class Group &lt; AR::Base
    default_scope where(:deleted_at =&gt; nil)
    validates_uniqueness_of :class_name
  end
  </code></pre>
  
  <p>and that is the same case as before, deleting a group then trying to find it by class name results in nil, however when I try to create a group with a known deleted class name it fails validation.</p>
  
  <p>Does anyone know if I am doing something wrong or should I just write custom validators for this behavior?</p>