diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-05 19:24:42 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-11 11:39:05 -0300 |
commit | 5de4fba6e34ebf31dc6e737bf96dbd65d3daf958 (patch) | |
tree | 0ab386f11239c0b0443edc167957712128fdd190 /app/services/boards | |
parent | 723ed9cc3a76f7ce0e2d1b358a33d05fb05865c9 (diff) | |
download | gitlab-ce-5de4fba6e34ebf31dc6e737bf96dbd65d3daf958.tar.gz |
Update Boards::Lists::DestroyService to remove list on a specic board
Diffstat (limited to 'app/services/boards')
-rw-r--r-- | app/services/boards/lists/destroy_service.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/boards/lists/destroy_service.rb b/app/services/boards/lists/destroy_service.rb index 25da3bfb56d..d75c5fd3dc6 100644 --- a/app/services/boards/lists/destroy_service.rb +++ b/app/services/boards/lists/destroy_service.rb @@ -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') |