Sha256: 4f18543623705a0543037cb8e68b87705155d3cd291c64f6bbee807ccf9350e4

Contents?: true

Size: 538 Bytes

Versions: 105

Compression:

Stored size: 538 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Errors

    # Raised when attempting to call create or create! through a
    # references_many when the parent document has not been saved. This
    # prevents the child from getting presisted and immediately being orphaned.
    class UnsavedDocument < MongoidError
      def initialize(base, document)
        super(
          compose_message(
            "unsaved_document",
            { base: base.class.name, document: document.class.name }
          )
        )
      end
    end
  end
end

Version data entries

105 entries across 100 versions & 7 rubygems

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