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

create_service.rb « boards « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fd9ff115eabc2d7e68973da8a2d1a03fc0662f28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Boards
  class CreateService < BaseService
    def execute
      if project.boards.empty?
        create_board!
      else
        project.boards.first
      end
    end

    private

    def create_board!
      board = project.boards.create
      board.lists.create(list_type: :closed)

      board
    end
  end
end