You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
I've just noticed this as well. The bug in the code is fairly obvious. See here how the newpos (new position of the item to be moved) is determined:
when :below
# the object given, can either be:
# -- the same as self
# -- already above self
# -- lower than self (higher number in list)
( self == object or (object.position < self.position) ) ? self.position : object.position + 1
So: Keep the same position if the object is itself, or if the object is already anywhere below this position. I'll try and fix this and propose a pull request.
test case: https://github.com/FND/dm-is-list/compare/below_bug
the first
.move :below
fails - yet it succeeds if first doing an arbitrary.move :above
Since the RSpec test case seems potentially confusing, here's a sample script that might make it clearer:
The text was updated successfully, but these errors were encountered: