thoughtbot/shoulda-matchers — pull request #220 by aclevy (2013-01-12 02:01:35+00:00)
Title: Fix for two datetime-related issues in validate_uniqueness_of 

This fixes two related problems that our team has encountered with `validate_uniqueness_of` and datetime attributes.

1. When testing for a uniqueness validation that is scoped to a datetime field, shoulda-matchers converts the scope attribute to a string so that it can call `next`, e.g. `"2013-01-07 15:46:43 UTC"` changes to `"2013-01-07 15:46:43 UTD"`. That isn't actually a different value, so the test fails.

2. When testing for a uniqueness validation on a datetime field which is usually nil, shoulda-matchers tries to use an integer to test the validation. This causes the assertion to fail. (We ran into this when scoping to a `deleted_at` column, so that we can reuse the same name if it's in the database but has been logically deleted.)