jnunemaker/plucky — pull request #26 by wpeterson (2012-11-13 03:37:50+00:00)
Title: Fix exists?() performance using find_one().

Use find_one() instead of count(), since it's faster on most datastores for large collections. Especially MongoDB, where count() can't use indexes properly.

More details in this blog post exploring performance problems traced to the original implementation:

http://blog.winfieldpeterson.com/2012/11/10/mongodb-indexing-count-unique-validations/