Update Boards::Lists::DestroyService to remove list on a specic board

parent 723ed9cc
......@@ -4,6 +4,8 @@ module Boards
def execute(list)
return false unless list.destroyable?
@board = list.board
list.with_lock do
decrement_higher_lists(list)
remove_list(list)
......@@ -12,6 +14,8 @@ module Boards
private
attr_reader :board
def decrement_higher_lists(list)
board.lists.movable.where('position > ?', list.position)
.update_all('position = position - 1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment