diff --git a/lib/crypt_keeper/provider/mysql_aes_new.rb b/lib/crypt_keeper/provider/mysql_aes_new.rb index e9cd874..5d71107 100644 --- a/lib/crypt_keeper/provider/mysql_aes_new.rb +++ b/lib/crypt_keeper/provider/mysql_aes_new.rb @@ -36,7 +36,7 @@ def decrypt(value) # # Returns an Enumerable def search(records, field, criteria) - records.select { |record| record[field] == criteria } + records.where("#{field} = ?", encrypt(criteria)) end end end