Sha256: d0bbb5b2b78ab114217fe8bce100c1b8489652acd02fc9a5f33fe39fb8bd9d72
Contents?: true
Size: 766 Bytes
Versions: 29
Compression:
Stored size: 766 Bytes
Contents
# frozen_string_literal: true module Mongoid module Errors # This error is raised when attempting to destroy a model which has # an association with dependency option set to restrict. class DeleteRestriction < MongoidError # Create the new callbacks error. # # @param [ Document ] document The document that was attempted to be # destroyed. # @param [ Symbol ] association_name The name of the dependent # association that prevents the document from being deleted. def initialize(document, association_name) super( compose_message( "delete_restriction", { document: document.class, relation: association_name } ) ) end end end end
Version data entries
29 entries across 29 versions & 1 rubygems