Add wcag en 2.2 import
Some checks failed
/ Run tests (push) Failing after 15s
/ Run system tests (push) Failing after 14s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-10-27 23:42:06 +01:00
parent 79da447d45
commit f21f75ad62
2 changed files with 67 additions and 7 deletions

View file

@ -12,13 +12,6 @@ class ChecklistEntry < ApplicationRecord
self.position ||= (checklist.checklist_entries.pluck(:position).max || 0) + 1
end
def normalize_positions
checklist.checklist_entries.where.not(id:).find_by(position:)&.update_attribute(:position, position_was)
# checklist.checklist_entries.order(:position).each_with_index do |entry, index|
# entry.update_column(:position, index + 1) if entry.position != index + 1
# end
end
def update_positions
if position_was
checklist.checklist_entries.where("position > ?", position_was).update_all("position = position - 1")