Make Procedure state consistent after switching types de champ order

Fixes an issue where, after clicking the "move champ up" button,
the new form is rendered with an incoherent order.
This commit is contained in:
Pierre de La Morinerie 2019-01-03 15:12:55 +01:00
parent 9466442aff
commit d77530c461
2 changed files with 17 additions and 10 deletions

View file

@ -176,6 +176,7 @@ class Procedure < ApplicationRecord
else
list[index_of_first_element].update(order_place: index_of_first_element + 1)
list[index_of_first_element + 1].update(order_place: index_of_first_element)
reload
true
end