Created
July 22, 2010 13:34
-
-
Save sheldonh/485965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/mongoid/document.rb | |
+++ b/lib/mongoid/document.rb | |
@@ -11,6 +11,15 @@ module Mongoid #:nodoc: | |
attr_reader :new_record | |
delegate :primary_key, :to => "self.class" | |
+ | |
+ unless self.instance_of?(Class) and self.name == "" | |
+ (@@descendants ||= {})[self] = :seen | |
+ end | |
+ end | |
+ | |
+ # Returns the classes that have included Mongoid::Document | |
+ def self.descendants | |
+ (@@descendants ||= {}).keys | |
end | |
module ClassMethods #:nodoc: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
merged. Thanks dude!