class Mongoid::Errors::NoParent

This error is raised when trying to persist an embedded document when there is no parent set.

Public Class Methods

new(klass) click to toggle source

Create the new error.

@example Create the new error.

NoParent.new(klass)

@param [ Class ] klass The class of the embedded document.

@since 3.0.0

Calls superclass method
# File lib/mongoid/errors/no_parent.rb, line 19
def initialize(klass)
  super(
    compose_message("no_parent", { klass: klass })
  )
end