datamapper/dm-validations — pull request #72 by tillsc (2014-12-30 13:51:47+00:00)
Title: Validation was scoped by type

Consider a class `Base` and a class `Child < Base` with a uniqueness check in `Base.some_property`

The uniqueness check did a `resource.model.first(opts)` where `resource.model` would resolve to `Child`. But nobody said that the uniqueness is scoped by the type (that should be done with `:scope => :type`).

This commit adds an (previously failing) spec and a fix