gitlab-org--gitlab-foss/app/services/labels/update_service.rb
gfyoung 265478ad74 Enable frozen string in apps/services/**/*.rb
For directories application_settings --> labels.

Partially addresses #47424.
2018-07-16 12:36:41 -07:00

17 lines
370 B
Ruby

# frozen_string_literal: true
module Labels
class UpdateService < Labels::BaseService
def initialize(params = {})
@params = params.dup.with_indifferent_access
end
# returns the updated label
def execute(label)
params[:color] = convert_color_name_to_hex if params[:color].present?
label.update(params)
label
end
end
end