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
I thought I had this reproduced, but I couldn't reproduce it. I'm going to close this for now unless someone can provide a test case that shows the bug.
Environment: Suppose
Item
hasacts_as_list
and a position column with default of 0.a = Item.create!
)b = Item.create!
)Expected behaviour:
a.position == 1
,b.position == 2
Actual behaviour:
a.position == 2
,b.position == 1
.I believe the culprit is 3ebaffc. The setting of the top position there is causing the check in
add_to_list_bottom
at https://github.com/swanandp/acts_as_list/blob/3ebaffc2680a7ba4ca5bef175e35ab0207e28562/lib/acts_as_list/active_record/acts/list.rb#L290 to take the wrong branch, and reverse the positions on the items.Am I missing something here, or is this a bug?
The text was updated successfully, but these errors were encountered: