title: DB issue in rails? Rails query and SQL query return different results (default_scope's fault?)
body: <p>We have over 29K users in our database. "User" is one of our tables and has a unique field "email" with an index defined in one of our migrations:</p>
  
  <pre><code>#3434324_devise_create_user.rb
  
  class DeviseCreateUsers &lt; ActiveRecord::Migration
    def change
      create_table(:users) do |t|
        t.string :email, :null =&gt; false, :default =&gt; ""
      end
      add_index :users, :email, :unique =&gt; true
    end
  end
  </code></pre>
  
  <p>We don't have any issues creating users... for the most part. However, with some emails <strong>(potentially those that have been previously deleted from the DB at one point or where created long time ago)</strong>, we are encountering a rare issue:</p>
  
  <p><strong>We can't create them because the "unique" validation fails</strong>, however, there is not a single user with that email.</p>
  
  <p>This is an example of what is happening (which does not make any sense if you ask me).</p>
  
  <p>When we try to create a user with the email "example@example.com":</p>
  
  <pre><code>$ p = Devise.friendly_token[0,20]
  $ User.create!({email: "example@example.com", password: p})
  </code></pre>
  
  <p>We get the following result:</p>
  
  <pre><code>(11.6ms)  BEGIN
    User Exists (11.2ms)  SELECT  1 AS one FROM "users"  WHERE "users"."email" = 'example@example.com' LIMIT 1
  (10.3ms)  ROLLBACK
    ActiveRecord::RecordInvalid: Validation failed: Email has already been taken
    from /Users/example/.rvm/gems/ruby-2.0.0-p451@example/gems/activerecord-4.1.6/lib/active_record/validations.rb:57:in `save!'
  </code></pre>
  
  <p>At the same time, if we look for that email in the database:</p>
  
  <pre><code>$ User.find_by_email("example@example.com")
  </code></pre>
  
  <p>It does not exist!</p>
  
  <pre><code>User Load (12.7ms)  SELECT  "users".* FROM "users"  WHERE "users"."disabled" = 'f' AND "users"."email" = 'example@example.com' LIMIT 1
  =&gt; nil
  </code></pre>
  
  <p>Does this make sense for any of you?</p>