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: f6275a6310946fcde2b7062ae228e938a288f1c6 (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: :done)

      board
    end
  end
end