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

Soft deleting models are not reordered as expected #31

Closed
sebdesign opened this issue Nov 18, 2016 · 1 comment
Closed

Soft deleting models are not reordered as expected #31

sebdesign opened this issue Nov 18, 2016 · 1 comment

Comments

@sebdesign
Copy link
Contributor

I have a model which uses the SoftDeletes trait and the SortableTrait. On the front-end of my app I'm displaying only the ordered non-trashed models, but on the back-end I'm including the trashed models, which can be reordered.

The soft deleting trait adds a constraint when the setNewOrder method is looping over the ids, therefore the order column is updated only on the non-trashed models. This is a bug because the new order is not synced across all the given models, which gives us duplicate order numbers, and that leads to unexpected results.

I'm happy to submit a PR if this is something that should be fixed. Thanks!

@freekmurze
Copy link
Member

I'd accept a PR that can fix this is an a simple way.

freekmurze pushed a commit that referenced this issue Nov 20, 2016
* Reorder soft-deleted records

Adds the ability to reorder models that use the `SoftDeletes` trait.

Fixes #31

* Remove above and below scopes
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