title: Rails 3. Validating email uniqueness and case sensitive fails
body: <p>I am developing an app in Rails 3 and upon signup I need the user to enter their email address and I need it to be unique and case sensitive. I.e. no one should be able to sign up with myEmail@yahoo.com when MyEmail@yahoo.com already exists in the database.</p>
  
  <p>This is my code and it crashes the app:</p>
  
  <pre><code>validates :email, :presence =&gt; true, :uniqueness =&gt; true, :case_sensitive =&gt; true,
                        :format =&gt; {:with =&gt; /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i}
  </code></pre>
  
  <p>What is wrong with it?</p>