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: ical.rb
    path of file: ./repos/openproject/app/models/token
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
#
# T
    
      def create_and_return_value(user, query, token_name)
        # using the ! here to raise an exception if the token could
        # not be created due to errors in the ical_token_query_assignment
        # otherwise a hashed token value of a not persisted token would be returned
        create!(user:, ical_token_query_assignment_attributes: {
                  query:, name: token_name
                }).plain_value
      end