app/models/query/manual_sorting.rb
def store_ordered_work_packages!
      bulk = ordered_work_packages.each_with_index.map do |wp_id, position|
        {
          query_id: id,
          work_package_id: wp_id,
          position: position
        }
      end

      OrderedWorkPackage.import bulk
    end
##
# Bulk insert the current set of ordered IDs
Bulk insert the current set of ordered IDs
Bulk insert the current set of ordered IDs
def store_ordered_work_packages!
      bulk = ordered_work_packages.each_with_index.map do |wp_id, position|
        {
          query_id: id,
          work_package_id: wp_id,
          position: position
        }
      end
      OrderedWorkPackage.import bulk
    end
def store_ordered_work_packages! bulk = ordered_work_packages . each_with_index . map do | wp_id , position | { query_id : id , work_package_id : wp_id , position : position } end OrderedWorkPackage . import bulk end
Bulk insert the current set of ordered IDs
Bulk insert the current set of ordered IDs