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: bulk_court_dates_controller.rb
    path of file: ./repos/casa/app/controllers
    
    the code of the file until where you have to start completion: class BulkCourtDatesController < ApplicationController
  include CourtDateParams

  before_action :require_o
    
  def create_court_dates(court_dates)
    court_date_with_error = nil
    ActiveRecord::Base.transaction do
      court_dates.each do |court_date|
        if !court_date.save
          court_date_with_error = court_date
          raise ActiveRecord::Rollback
        end
      end
    end