brendon / acts_as_list

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

Avoid collision when add_new_at is nil #411

Closed brendon closed 1 year ago

brendon commented 1 year ago

Rename add_to_list_top and add_to_list_bottom private methods to avoid_collision that handles both cases as well as the case where :add_new_at is nil. Setting an explicit position when :add_new_at is nil will now shuffle other items out of the way if necessary.

Fixes #410