brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.04k stars 355 forks source link

Rebalance positions in the case of duplicates #284

Closed brendon closed 5 years ago

brendon commented 7 years ago

Hi @swanandp, I ran into this in my project where I had some buggy duplicate positions. I wondered if we should perhaps detect and fix duplicates within scopes? I think it'd be a good idea.

Do you have any ideas on how to go about it? There doesn't seem to be an easy SQL way to do it. Perhaps this: