CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 164
Fixed compatibility with Mongoid 4.x. #146
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
Conversation
The current plan is to maintain two different versions after Mongoid 4 is released. One for Mongoid 3 and Rails 3, and one for Mongoid 4 and Rails 4. However, there is unfortunately no way we can proceed on that plan until a version of Mongoid 4 is released. |
I am running into this issue too. If I read the statements over at mongoid correctly there won't be an official version before the end of the year since they are waiting for an offical release of the 10gen BSON gem which is set for 31st December 2013. Why not create a mongoid_4 branch here so work could start on a Mongoid 4 compatible version? |
Short of that you can use https://github.com/dblock/mongoid-slug/tree/mongoid-4x |
@dblock @cweyer I am not against creating a branch with Mongoid 4 support, but then we need to document best practices since Mongoid 4 is not released and it will not be possible to release Mongoid Slug with Rails 4 support as a gem until Mongoid 4 is released. Does any of you have experience with running Mongoid 4 in production? Looking at the Mongoid issue tracker it looks like it is far from release, are there breaking and potentially unsafe changes in Mongoid 4 master at this point? |
Indeed the DSL changed at some points and there are still some bugs in it. We use it in production (although beta) since nearly two months and worked around some issues with atomic updates, the inc function for example doesn't seem to have any effect right now. The version we use is rather old (https://github.com/mongoid/mongoid/tree/38de2e96edc8f64fbe3cdbe062f1d91e9feb388d) because it doesnt have that many breaking changes. I wanted to updated recently and ran in the issues mentioned above, so we are stuck with that release for now. I was under the impression mongoid 4 would be released together with Rails 4 back in the day, otherwise I would never have used it in a soon-to-be production code base, but now I don't want to migrate back. |
I have made this compatible with both Mongoid 3 and 4. Enjoy. |
Fixed compatibility with Mongoid 4.x.
@dblock Looks good to me. Thanks! :) |
@digitalplaywright looks like it's working here. Not much specs on this area but all green. |
@digitalplaywright sorry for the very late response I was on vacation. I'm still getting a NameError: uninitialized constant Moped::BSON::Document error whenever I load a class that includes Mongoid but there is so much stuff that seems half baking in our dependencies I can't really tell where it's coming from, seems to be moped/connection. I will investigate further during the week |
@cweyer No problem. Let me know if you experience any problems and if you have any failing test-cases. Currently Mongoid Slug is passing the test-suite on both Mongoid 3 with Rails 3 and Mongoid 4 with Rails 4. |
Ok I cleaned it up, now works like a charm |
Don't merge, this will break compatibility with Mongoid 3.x.
It looks like Mongoid 4 is back to using
BSON::ObjectId
and thatMoped::BSON::ObjectId
has been removed. I am not sure how we can implement this in a way compatible with both.