Permalink
Browse files

make the adapter work in the case where the document classes are

evaluated before the adapter inserts its code into the various MM
modules. This uses a commit I added to MongoMapper here:
http://bit.ly/4Ryb0r, and it may not be committed yet.
  • Loading branch information...
1 parent dad976b commit c58ab865994c45b6a92294bc87849d61841aae28 Aubrey Holland committed with Dec 21, 2009
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/machinist/mongomapper.rb
View
5 lib/machinist/mongomapper.rb
@@ -56,8 +56,7 @@ def make(*args, &block)
end
end
-
-MongoMapper::Document::ClassMethods.send(:include, Machinist::Blueprints::ClassMethods)
-MongoMapper::Document::ClassMethods.send(:include, Machinist::MongoMapperExtensions::Document)
+MongoMapper::Document.append_extensions(Machinist::Blueprints::ClassMethods)
+MongoMapper::Document.append_extensions(Machinist::MongoMapperExtensions::Document)
MongoMapper::EmbeddedDocument::ClassMethods.send(:include, Machinist::Blueprints::ClassMethods)
MongoMapper::EmbeddedDocument::ClassMethods.send(:include, Machinist::MongoMapperExtensions::EmbeddedDocument)

0 comments on commit c58ab86

Please sign in to comment.