Skip to content

Support for mongoid 8.0 #18

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

Closed
danarnold opened this issue Nov 3, 2022 · 6 comments · Fixed by #19
Closed

Support for mongoid 8.0 #18

danarnold opened this issue Nov 3, 2022 · 6 comments · Fixed by #19

Comments

@danarnold
Copy link

Are there any plans to support mongoid 8.0?

@ElMassimo
Copy link
Owner

I'm no longer using MongoDB on a regular basis, but I just cut a new release that should allow you to install this library with Mongoid 8.

Let me know how it goes!

@danarnold
Copy link
Author

Thanks for the quick reply and action. I'll be sure to reply with any updates.

@danarnold
Copy link
Author

We've been using this code in production since Monday without any issues. Things seem to be working well. 👍

@1st8
Copy link

1st8 commented Aug 30, 2024

I am seeing N+1 with Mongoid 8.1 (and a polymorphic belongs_to).

@danarnold Are you sure there are no hidden N+1 happening in you system?

Will report here when I know more.

@1st8
Copy link

1st8 commented Aug 30, 2024

Figured out that it was a combination of inheritance on the class being queried and polymorphic belongs_to.

Querying on the base class with BaseClass.includes(:something_polymorphic).where(_type: "MyExtendedClass") fortunately works around the issue.

@danarnold
Copy link
Author

@1st8 The failing test referenced in PR #21 is one relating to polymorphic belongs_to:

Mongoid::Includes::Criteria#includes multiple inclusions through polymorphic associations :with inclusions should not be overriden

So, it makes sense that this might be broken here as well, since the test was failing before any of my changes. I didn't test mongoid versions before 8 to see how far back this issue goes.

The app I work on that uses mongoid_includes doesn't have any of this type of association, so it isn't something that I would've noticed outside of the test failure, and when I reported that it was working in my 2022 comment, it was in the context of this same app.

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

Successfully merging a pull request may close this issue.

3 participants