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.



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

def hereditary?
  Mongoid::Document > superclass
end