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

module Alchem
    
    def delete_elements
      case elements
      when ActiveRecord::Associations::CollectionProxy
        elements.delete_all(:delete_all)
      when ActiveRecord::Relation
        elements.delete_all
      else
        Alchemy::Element.where(id: elements).delete_all
      end