mongoid/mongoid — pull request #1657 by priyaaank (2012-01-30 17:39:24+00:00)
Title: #1656 Don't hit database for uniqueness validation if BOTH scope and attribute hasn't changed.

Currently uniqueness constraint is violated, if attribute on a mongoid document hasn't changed but scope has. To ensure that it doesn't happen, we need to make sure that scope reference hasn't changed either. Making a fix to check that. Submitting a pull request to fix newly opened bug #1656.