Skip to content
Snippets Groups Projects
Unverified Commit 693cf26d authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix

parent 19ec4b6d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment