2016-07-27 16:41:19 -04:00
|
|
|
module Boards
|
2016-08-02 20:49:26 -04:00
|
|
|
class CreateService < BaseService
|
2016-07-27 16:41:19 -04:00
|
|
|
def execute
|
2016-07-28 00:36:38 -04:00
|
|
|
create_board! unless project.board.present?
|
|
|
|
project.board
|
2016-07-27 16:41:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2016-07-28 00:36:38 -04:00
|
|
|
def create_board!
|
|
|
|
project.create_board
|
2016-07-28 18:26:16 -04:00
|
|
|
project.board.lists.create(list_type: :backlog)
|
|
|
|
project.board.lists.create(list_type: :done)
|
2016-07-28 00:36:38 -04:00
|
|
|
end
|
2016-07-27 16:41:19 -04:00
|
|
|
end
|
|
|
|
end
|