gitlab-org--gitlab-foss/app/services/boards/create_service.rb

22 lines
371 B
Ruby
Raw Normal View History

module Boards
2016-10-07 15:46:32 -04:00
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: :backlog)
board.lists.create(list_type: :closed)
board
end
end
end