debian-mirror-gitlab/app/services/boards/create_service.rb

21 lines
325 B
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
module Boards
2016-11-03 12:29:30 +05:30
class CreateService < BaseService
2016-09-13 17:45:13 +05:30
def execute
2016-11-03 12:29:30 +05:30
if project.boards.empty?
create_board!
else
project.boards.first
end
2016-09-13 17:45:13 +05:30
end
private
def create_board!
2016-11-03 12:29:30 +05:30
board = project.boards.create
2017-08-17 22:00:37 +05:30
board.lists.create(list_type: :closed)
2016-11-03 12:29:30 +05:30
board
2016-09-13 17:45:13 +05:30
end
end
end