Sha256: bca2844d932be1f48da1213272affda807d04ca31e36454d7bdbed124c9a0cb1

Contents?: true

Size: 583 Bytes

Versions: 24

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  module Errors

    # Raised when attempting to destroy a document that had destroy callbacks
    # return false.
    class DocumentNotDestroyed < MongoidError

      # Instantiate the exception.
      #
      # @example Create the error.
      #   DocumentNotDestroyed.new(Band)
      #
      # @param [ Object ] id The document id.
      # @param [ Class ] klass The document class.
      def initialize(id, klass)
        super(compose_message("document_not_destroyed", { id: id.inspect, klass: klass }))
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-8.0.1 lib/mongoid/errors/document_not_destroyed.rb
mongoid-7.5.0 lib/mongoid/errors/document_not_destroyed.rb
mongoid-7.4.1 lib/mongoid/errors/document_not_destroyed.rb
mongoid-7.4.0 lib/mongoid/errors/document_not_destroyed.rb