Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:485965
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
--- 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:

merged. Thanks dude!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.