debian-mirror-gitlab/app/services/boards/create_service.rb
2017-08-17 22:00:37 +05:30

20 lines
325 B
Ruby

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