title: Querying in rails on attr_encrypted column
body: <p>I have a ruby on rails app and I am using the <code>attr_encrypted</code> gem to encrypt some user info. It has a salt and IV so it is 2 way encrypted. The gem intercepts dynamic <code>find_by</code> to assist with querying, but that is not a sufficient query for my case as I care about the number of results.</p>
  
  <p>Is there a way to query the table to return all results that match a given <code>secret</code>?</p>
  
  <p>Here is the example. I have a <code>users</code> table and it has an encrypted <code>secret</code> attribute. The table thus has <code>encrypted_secret</code>, <code>encrypted_secret_iv</code>, and <code>encrypted_secret_salt</code>. If a user gave a secret of "abd123", how can I query the table to see how many others have also used "abc123" as their secret?</p>