Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPRECATION WARNING when using mongomapper and Rails 3.2.3 / patch #2

Closed
nachbar opened this issue May 28, 2012 · 2 comments
Closed

Comments

@nachbar
Copy link

nachbar commented May 28, 2012

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


phstc pushed a commit that referenced this issue May 29, 2012
@phstc
Copy link
Owner

phstc commented May 29, 2012

@nachbar thank you for reporting that! Could you update your Gemfile gem "mongomapper_id2", "~> 0.0.5".

Cheers

@phstc phstc closed this as completed May 29, 2012
@nachbar
Copy link
Author

nachbar commented Jun 6, 2012

That fixed it!

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.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants