Sha256: 53880f4330260e1db472001c0633ad6e1fa057e2e5d9d0388da7cc3677e89400

Contents?: true

Size: 716 Bytes

Versions: 21

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

module Mongoid
  module Errors

    # This error is raised when calling #save! or .create! on a model when one
    # of the callbacks returns false.
    class DeleteRestriction < MongoidError

      # Create the new callbacks error.
      #
      # @example Create the new callbacks error.
      #   Callbacks.new(Post, :create!)
      #
      # @param [ Class ] document
      # @param [ Symbol ] association
      #
      # @since 3.0.0
      def initialize(document, relation)
        super(
          compose_message(
            "delete_restriction",
            { document: document.class, relation: relation }
          )
        )
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
mongoid-7.1.11 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.6 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.5 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.10 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.9 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.4 lib/mongoid/errors/delete_restriction.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.3 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.8 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.2 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.1 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.7 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.0 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.6 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.5 lib/mongoid/errors/delete_restriction.rb
mongoid-7.2.0.rc1 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.4 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.2 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.1 lib/mongoid/errors/delete_restriction.rb
mongoid-7.1.0 lib/mongoid/errors/delete_restriction.rb