You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting a deprecation warning whenever I start rails server or console. The exact message is:
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in MongoMapper::Plugins::AutoIncrement instead. (called from require at /Users/nachbar/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68)
Following those instructions (just moving the instance methods outside of InstanceMethods, but also removing the InstanceMethods module definition), the deprecation message no longer appears. The patch is:
From: James Nachbar <nachbar@plastic.org>
Date: Mon, 28 May 2012 13:35:11 -0700
Subject: [PATCH] Removed definition of InstanceMethods module, defining
instance methods directly in ::AutoIncrement, to prevent
deprecation warning
---
lib/mongomapper_id2.rb | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/lib/mongomapper_id2.rb b/lib/mongomapper_id2.rb
index 6648812..13f8c93 100644
--- a/lib/mongomapper_id2.rb
+++ b/lib/mongomapper_id2.rb
@@ -15,7 +15,6 @@ module MongoMapper
end
end
end
- module InstanceMethods
private
def update_auto_increment
self.id2 = MongomapperId2::Incrementor[self.class.name].inc
@@ -24,7 +23,6 @@ module MongoMapper
update_auto_increment
self.id = self.id2.to_s
end
- end
end
end
end
--
1.7.5.4
The text was updated successfully, but these errors were encountered:
However, interestingly, when I put that in the Gemfile, it also updated the mongo and bson drivers to 1.6.3 (that release of mongo was released today!) and that seriously broke my setup. Any attempt to delete an object with mongo_mapper caused the server to hang. However, fixing the mongo driver to 1.6.2 fixed that problem, and all of my tests still pass using the 0.0.5 version of mongomapper_id2.
I am getting a deprecation warning whenever I start rails server or console. The exact message is:
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in MongoMapper::Plugins::AutoIncrement instead. (called from require at /Users/nachbar/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68)
Following those instructions (just moving the instance methods outside of InstanceMethods, but also removing the InstanceMethods module definition), the deprecation message no longer appears. The patch is:
The text was updated successfully, but these errors were encountered: