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

module Api
  module Internal
    class MultipleEpisodeRecordsController < Api::Internal::ApplicationController
      before_action :authenticate_user!

      def create
        episodes = Episode.only_kept.where(id: params[:episode_ids]).ord
    
      def create
        episodes = Episode.only_kept.where(id: params[:episode_ids]).order(:sort_number)

        ActiveRecord::Base.transaction do
          episodes.each do |episode|
            form = Forms::EpisodeRecordForm.new(user: current_user, episode: episode)

            if form.invalid?
              return render json: form.errors.full_messages, status: :unprocessable_entity
            end

            Creators::EpisodeRecordCreator.new(user: current_user, form: form).call
          end
        end