thoughtbot/shoulda-matchers — pull request #500 by ivanvc (2014-04-19 16:17:34+00:00)
Title: Fixes uniqueness matcher for enum columns

As I was updating an application to Rails 4.1, changed some columns that used to be Strings with limited possible values to enums. And found that one of this is scoped to a uniqueness validation, which made the `validate_uniqueness_of(...).scoped_to(...)` matcher to fail. Here's the code that made it fail:

```ruby
class App << ActiveRecord::Base
enum platform: [:iOS, :android]
validates :store_id, uniqueness: { scope: :platform }
end

describe App
subject { ... }
it { should validate_uniqueness_of(:store_id).scoped_to(:platform:)
end
```

So, here's a PR that fixes this problem.