You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: base_type_service.rb
    path of file: ./repos/openproject/app/services
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
#
    
  def update(params, options)
    success = false
    errors = type.errors

    Type.transaction do
      success, errors = set_params_and_validate(params)
      if success
        after_type_save(params, options)
      else
        raise(ActiveRecord::Rollback)
      end
    end