Permalink
Browse files

Bring mongomapper up to date. Remember that you need mongo_ext in ord…

…er to use MongoMapper with Devise.
  • Loading branch information...
1 parent a5b2ee5 commit 394b1ff444c2fbc6bbbe899f9327fa080b87d759 @josevalim josevalim committed Jan 16, 2010
View
@@ -4,6 +4,7 @@
* enhancements
* Added devise lockable (by github/mhfs)
* Warden 0.9.0 compatibility
+ * Mongomapper 0.6.10 compatibility
== 0.8.2
@@ -54,7 +54,8 @@
# config.unlock_in = 1.hour
# ==> General configuration
- # Load and configure the ORM. Supports :active_record, :data_mapper and :mongo_mapper.
+ # Load and configure the ORM. Supports :active_record (default), :mongo_mapper
+ # (requires mongo_ext installed) and :data_mapper (experimental).
# require 'devise/orm/mongo_mapper'
# config.orm = :mongo_mapper
@@ -12,7 +12,7 @@ def save(flag=nil)
end
def self.included_modules_hook(klass, modules)
- klass.send :extend, self
+ klass.send :extend, self
klass.send :include, InstanceMethods
yield
@@ -1,8 +1,19 @@
module Devise
module Orm
module MongoMapper
+ module InstanceMethods
+ def save(options={})
+ if options == false
+ super(:validate => false)
+ else
+ super
+ end
+ end
+ end
+
def self.included_modules_hook(klass, modules)
- klass.send :extend, self
+ klass.send :extend, self
+ klass.send :include, InstanceMethods
yield
modules.each do |mod|
View
@@ -16,6 +16,5 @@ class ActiveSupport::TestCase
setup do
User.delete_all
Admin.delete_all
- Account.delete_all
end
end

0 comments on commit 394b1ff

Please sign in to comment.