2019-06-17 08:58:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Boards
|
|
|
|
class UpdateService < Boards::BaseService
|
2021-03-04 07:11:11 -05:00
|
|
|
PERMITTED_PARAMS = %i(name hide_backlog_list hide_closed_list).freeze
|
|
|
|
|
2019-06-17 08:58:48 -04:00
|
|
|
def execute(board)
|
2021-03-04 07:11:11 -05:00
|
|
|
filter_params
|
2019-06-17 08:58:48 -04:00
|
|
|
board.update(params)
|
|
|
|
end
|
2021-03-04 07:11:11 -05:00
|
|
|
|
|
|
|
def filter_params
|
|
|
|
params.slice!(*permitted_params)
|
|
|
|
end
|
|
|
|
|
|
|
|
def permitted_params
|
|
|
|
PERMITTED_PARAMS
|
|
|
|
end
|
2019-06-17 08:58:48 -04:00
|
|
|
end
|
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
|
|
|
Boards::UpdateService.prepend_if_ee('EE::Boards::UpdateService')
|