Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Conversation

@rykov
Copy link

@rykov rykov commented Jul 16, 2013

Currently, uniqueness validation check is done by calling resource.model.first, which only scopes the query to that particular class. This patch uses property.model instead to scope the query to the class in which the property was defined and its children.

This is the best solution that I could find. There is no easy way to scope the query to the class which calls validates_uniqueness_of, only the class that defines the property.

@jordanyee
Copy link

@rykov Thanks for the fix. I've just run into this issue (and wrote some tests too). Is there anything I can do to help this pull request along?

@hamzakc
Copy link

hamzakc commented Dec 10, 2013

+1, I have just run into this bug as well.

@tillsc
Copy link
Contributor

tillsc commented Dec 30, 2014

I fixed that problem (a bit different) for the current master (1.3.0.beta) in #72 . After merging my pull request this pull request can AFAICS be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants