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

v2.1.4 breaks backwards compatibility with v2.1.3 #276

Open
dmcnally opened this issue Nov 10, 2015 · 5 comments
Open

v2.1.4 breaks backwards compatibility with v2.1.3 #276

dmcnally opened this issue Nov 10, 2015 · 5 comments
Labels

Comments

@dmcnally
Copy link

The following addition v2.1.3...v2.1.4#diff-ccbdb603cb37c0f5ccb9d8b62932dee4R258 breaks backwards compatibility with v2.1.3

Previous behaviour validated uniqueness constraints across the entire dataset of deleted and non deleted items.

New behaviour seems to exclude deleted items from uniqueness validations.

There doesn't seem to be any way to selective revert to previous behaviour.

@radar
Copy link
Collaborator

radar commented Nov 10, 2015

Ouch. I'd consider this serious enough to revert it in a commit, and release 2.1.5 with that revert, then to have a discussion on the original issue about whether or not that should be within paranoia. I believe the answer would be "yes it should be", but we'll probably need it to be opt-in.

Please submit a PR which reverts that behaviour. I will review it and then if it's acceptable, merge it then release 2.1.5.

On 10 Nov 2015, at 19:03, David McNally [email protected] wrote:

The following addition v2.1.3...v2.1.4#diff-ccbdb603cb37c0f5ccb9d8b62932dee4R258 breaks backwards compatibility with v2.1.3

Previous behaviour validated uniqueness constraints across the entire dataset of deleted and non deleted items.

New behaviour seems to exclude deleted items from uniqueness validations.

There doesn't seem to be any way to selective revert to previous behaviour.


Reply to this email directly or view it on GitHub.

@dmcnally
Copy link
Author

Please see PR #277

@laffy
Copy link

laffy commented Nov 10, 2015

It would nice nice to include a flag when defining a model as acts_as_paranoid so that you could choose whether to validate archived records or not.

@dmcnally
Copy link
Author

@laffy I don't think that will work. You need to specify at the validation level if the deleted items should be included or not.

Our situation has us requiring

  • a unique reference that covers all objects
  • a second unique constraint covers non-deleted objects

This allows us to have a unique reference that can be used to find archived items but reuse the same titles/names etc for non-archived.

@donv
Copy link
Contributor

donv commented Mar 11, 2016

This is biting us now: We need uniqueness validation of a string column across all records to be able to restore a record and still be sure the column is unique.

This works fine with paranoia 2.1.3 but fails with 2.1.4 and 2.1.5.

We can accept that the default is to only validate uniqueness across non-deleted records, but we need a way to specify per validation rule wether uniqueness should be across all records or across non-deleted records only.

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

No branches or pull requests

5 participants