Skip to content

Commit

Permalink
[B] Changing position updates model property
Browse files Browse the repository at this point in the history
See brendon/acts_as_list#23 for context. We
were seeing an issue in which moving a model up in the list would not
update the models position property if there were two items in the list.
For now, we're reloading the model after changing the position to ensure
an accurate position property.
  • Loading branch information
zdavis committed Jun 13, 2017
1 parent 23d67e8 commit e19c116
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/app/lib/updaters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,7 @@ def update_position(model)
when "bottom"
model.move_to_bottom
end
# https://github.com/swanandp/acts_as_list/issues/23
model.reload
end
end

0 comments on commit e19c116

Please sign in to comment.