Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5de4fba6
Commit
5de4fba6
authored
Oct 05, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Boards::Lists::DestroyService to remove list on a specic board
parent
723ed9cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
app/services/boards/lists/destroy_service.rb
app/services/boards/lists/destroy_service.rb
+4
-0
No files found.
app/services/boards/lists/destroy_service.rb
View file @
5de4fba6
...
@@ -4,6 +4,8 @@ module Boards
...
@@ -4,6 +4,8 @@ module Boards
def
execute
(
list
)
def
execute
(
list
)
return
false
unless
list
.
destroyable?
return
false
unless
list
.
destroyable?
@board
=
list
.
board
list
.
with_lock
do
list
.
with_lock
do
decrement_higher_lists
(
list
)
decrement_higher_lists
(
list
)
remove_list
(
list
)
remove_list
(
list
)
...
@@ -12,6 +14,8 @@ module Boards
...
@@ -12,6 +14,8 @@ module Boards
private
private
attr_reader
:board
def
decrement_higher_lists
(
list
)
def
decrement_higher_lists
(
list
)
board
.
lists
.
movable
.
where
(
'position > ?'
,
list
.
position
)
board
.
lists
.
movable
.
where
(
'position > ?'
,
list
.
position
)
.
update_all
(
'position = position - 1'
)
.
update_all
(
'position = position - 1'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment