Sha256: 32fa786276db512d92448e3493793ddc14642ad6ee37e47a92798291bcbc9894

Contents?: true

Size: 683 Bytes

Versions: 29

Compression:

Stored size: 683 Bytes

Contents

# 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 ] relation
      #
      # @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

29 entries across 29 versions & 2 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.12 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.8 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.11 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.10 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.7 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.5 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.8 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.7 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.6 lib/mongoid/errors/delete_restriction.rb
mongoid-5.4.1 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.5 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.4 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.4 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.3 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.2 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.2 lib/mongoid/errors/delete_restriction.rb
mongoid-7.0.1 lib/mongoid/errors/delete_restriction.rb
mongoid-6.4.1 lib/mongoid/errors/delete_restriction.rb
mongoid-5.4.0 lib/mongoid/errors/delete_restriction.rb