debian-mirror-gitlab/app/services/labels/update_service.rb

16 lines
339 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
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