Add wcag en 2.2 import
This commit is contained in:
parent
79da447d45
commit
f21f75ad62
2 changed files with 67 additions and 7 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue