Remove Boards::BaseService

parent e171c1d8
module Boards
class BaseService < ::BaseService
end
end
module Boards module Boards
class CreateService < Boards::BaseService class CreateService < BaseService
def execute def execute
if project.boards.empty? if project.boards.empty?
create_board! create_board!
......
module Boards module Boards
module Issues module Issues
class CreateService < Boards::BaseService class CreateService < BaseService
def execute def execute
create_issue(params.merge(label_ids: [list.label_id])) create_issue(params.merge(label_ids: [list.label_id]))
end end
......
module Boards module Boards
module Issues module Issues
class ListService < Boards::BaseService class ListService < BaseService
def execute def execute
issues = IssuesFinder.new(current_user, filter_params).execute issues = IssuesFinder.new(current_user, filter_params).execute
issues = without_board_labels(issues) unless list.movable? issues = without_board_labels(issues) unless list.movable?
......
module Boards module Boards
module Issues module Issues
class MoveService < Boards::BaseService class MoveService < BaseService
def execute(issue) def execute(issue)
return false unless can?(current_user, :update_issue, issue) return false unless can?(current_user, :update_issue, issue)
return false unless valid_move? return false unless valid_move?
......
module Boards module Boards
class ListService < Boards::BaseService class ListService < BaseService
def execute def execute
create_board! if project.boards.empty? create_board! if project.boards.empty?
project.boards project.boards
......
module Boards module Boards
module Lists module Lists
class CreateService < Boards::BaseService class CreateService < BaseService
def execute(board) def execute(board)
List.transaction do List.transaction do
label = project.labels.find(params[:label_id]) label = project.labels.find(params[:label_id])
......
module Boards module Boards
module Lists module Lists
class DestroyService < Boards::BaseService class DestroyService < BaseService
def execute(list) def execute(list)
return false unless list.destroyable? return false unless list.destroyable?
......
module Boards module Boards
module Lists module Lists
class GenerateService < Boards::BaseService class GenerateService < BaseService
def execute(board) def execute(board)
return false unless board.lists.movable.empty? return false unless board.lists.movable.empty?
......
module Boards module Boards
module Lists module Lists
class ListService < Boards::BaseService class ListService < BaseService
def execute(board) def execute(board)
board.lists board.lists
end end
......
module Boards module Boards
module Lists module Lists
class MoveService < Boards::BaseService class MoveService < BaseService
def execute(list) def execute(list)
@board = list.board @board = list.board
@old_position = list.position @old_position = list.position
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment