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

Fix uniqueness validator for non-paranoid models. #256

Open
wants to merge 1 commit into
base: rails3
Choose a base branch
from

Conversation

mlabarca
Copy link

As I mentioned on #250, simply attempting to create a non paranoid model with an uniqueness validation fails since it attempts to filter out records with paranoid column != nil from the relation. This is the very same fix in 3b6ff6e but for this rails3 branch which is what I'm depending on.

tddrmllr pushed a commit to tddrmllr/paranoia that referenced this pull request Nov 25, 2015
@leklund
Copy link

leklund commented Dec 7, 2015

👍 for fixing this for the rails3 branch.

It could also be done guard clause style since that's how it is the rails4 branch currently: https://github.com/rubysherpas/paranoia/blob/rails4/lib/paranoia.rb#L265

@leklund
Copy link

leklund commented Dec 7, 2015

After some more thought, I'm in favor of reverting the uniqueness validator as in #277

@Jesus
Copy link

Jesus commented Aug 2, 2016

Many thanks for this patch.

I had to fork the repo in order to use because it looks like it won't be merged. But that's ok for me.

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

Successfully merging this pull request may close these issues.

4 participants