Module: Mongoid::Hierarchy::ClassMethods

Defined in:
lib/mongoid/hierarchy.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#hereditary?true, false

Determines if the document is a subclass of another document.

Examples:

Check if the document is a subclass.

Square.hereditary?

Returns:

  • (true, false)

    True if hereditary, false if not.



117
118
119
# File 'lib/mongoid/hierarchy.rb', line 117

def hereditary?
  Mongoid::Document > superclass
end