Skip to content

@sheldonh /gist:485965
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
--- 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:
@railsjedi

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.