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 21:56:49 +00:00
class ListService < Boards::BaseService
def execute
2017-08-28 21:56:49 +00:00
create_board! if parent.boards.empty?
2018-03-28 18:32:13 +00:00
boards
end
private
2018-03-28 18:32:13 +00:00
def boards
parent.boards
end
def create_board!
2017-08-28 21:56:49 +00:00
Boards::CreateService.new(parent, current_user).execute
end
end
end