Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a record does not take into account ActiveRecord validations #285

Open
spint opened this issue Dec 8, 2015 · 1 comment
Open

Comments

@spint
Copy link

spint commented Dec 8, 2015

Since version 2.1.4, (uniqueness) validations checks only non-deleted records.
However, restoring a record that violates a Rails uniqueness constraint passes without an error.
Shouldn't the validations be considered before saving the restored record to the database?

@andrewferk
Copy link

Looks to be the same as #319 and #333 is a proposed fix.

For now, you can enforce the uniqueness at the database by updating your indexes. When you try to restore and it violates the database index, a mysql error should be raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants