From 693cf26d19fafdaa0ff3bdf3fd4ea8d19f3e2d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Mon, 17 Jan 2022 19:44:19 +0100 Subject: [PATCH] fix --- app/controllers/concerns/admin/reorderable.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/concerns/admin/reorderable.rb b/app/controllers/concerns/admin/reorderable.rb index 949be51e3..de9ba74f4 100644 --- a/app/controllers/concerns/admin/reorderable.rb +++ b/app/controllers/concerns/admin/reorderable.rb @@ -4,10 +4,12 @@ module Admin::Reorderable included do def reorder ids = params[:ids] || [] + first_object = model.find_by(id: ids.first) ids.each.with_index do |id, index| object = model.find_by(id: id) object.update_column(:position, index + 1) unless object.nil? end + first_object.sync_with_git if first_object&.respond_to?(:sync_with_git) end def model -- GitLab