Permalink
Browse files

Fixed MongoMapper adapter in order to get it working with versions >=…

… 0.8.0

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 73e5d84 commit a41025e421c2727a8c4098092515e4da8c17c3ca @ivanvc ivanvc committed with josevalim Jun 21, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/devise/orm/mongo_mapper.rb
@@ -43,5 +43,10 @@ def apply_schema(name, type, options={})
end
end
-MongoMapper::Plugins::Document::ClassMethods.send(:include, Devise::Models)
-MongoMapper::Plugins::EmbeddedDocument::ClassMethods.send(:include, Devise::Models)
+if MongoMapper::Version >= "0.8.0"
+ MongoMapper::Plugins::Document::ClassMethods.send(:include, Devise::Models)
+ MongoMapper::Plugins::EmbeddedDocument::ClassMethods.send(:include, Devise::Models)
+else
+ MongoMapper::Document::ClassMethods.send(:include, Devise::Models)
+ MongoMapper::EmbeddedDocument::ClassMethods.send(:include, Devise::Models)
+end

0 comments on commit a41025e

Please sign in to comment.