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: comment_votes_controller.rb
    path of file: ./repos/danbooru/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class CommentVotesController < ApplicationController
  respond_to :js, :json, :xml, :html

  rate_limit :create,  rate: 1.0/1.second, burst: 200
  rate_limit :destroy, rate: 1.0/1.second, burst: 200

  def index
    @comment_votes = authorize CommentVote.visible(CurrentUser.user).paginated_search(params, count_pages: true)
    @comment_votes = @comm
    
  def create
    @comment = Comment.find(params[:comment_id])

    @comment.with_lock do
      @comment_vote = authorize CommentVote.new(comment: @comment, score: params[:score], user: CurrentUser.user)

      CommentVote.active.where(comment: @comment, user: CurrentUser.user).each do |vote|
        vote.soft_delete!(updater: CurrentUser.user)
      end

      @comment_vote.save
    end

    flash.now[:notice] = @comment_vote.errors.full_messages.join("; ") if @comment_vote.errors.present?
    respond_with(@comment_vote)
  end