Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-28 07:36:38 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:57 +0300
commit4180a15c568a16371e14a869166827a7998e993b (patch)
tree1350671f879f8f4e382e65ccf9226bf5feed29c7 /app/services
parentb23683b00b4bccad3b6f29d722b9e45a7264c1bd (diff)
Create Backlog/Done lists when creating a new board
Diffstat (limited to 'app/services')
-rw-r--r--app/services/boards/create_service.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/services/boards/create_service.rb b/app/services/boards/create_service.rb
index 9c1c2da079d..44e937af8c6 100644
--- a/app/services/boards/create_service.rb
+++ b/app/services/boards/create_service.rb
@@ -5,15 +5,18 @@ module Boards
end
def execute
- if project.board.present?
- project.board
- else
- project.create_board
- end
+ create_board! unless project.board.present?
+ project.board
end
private
attr_reader :project
+
+ def create_board!
+ project.create_board
+ project.board.lists.create(list_type: :backlog, position: 0)
+ project.board.lists.create(list_type: :done, position: 1)
+ end
end
end