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

21 lines
328 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Boards
2017-08-28 17:56:49 -04:00
class ListService < Boards::BaseService
def execute
2017-08-28 17:56:49 -04:00
create_board! if parent.boards.empty?
2018-03-28 14:32:13 -04:00
boards
end
private
2018-03-28 14:32:13 -04:00
def boards
parent.boards
end
def create_board!
2017-08-28 17:56:49 -04:00
Boards::CreateService.new(parent, current_user).execute
end
end
end