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-3.0.3 lib/mongoid/errors/unsaved_document.rb
mongoid-3.0.2 lib/mongoid/errors/unsaved_document.rb
mongoid-3.0.1 lib/mongoid/errors/unsaved_document.rb
mongoid-3.0.0 lib/mongoid/errors/unsaved_document.rb
mongoid-3.0.0.rc lib/mongoid/errors/unsaved_document.rb