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.



17
18
19
# File 'lib/mongoid/hierarchy.rb', line 17

def hereditary?
  Mongoid::Document > superclass
end