-
Notifications
You must be signed in to change notification settings - Fork 66
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
SCI & criteria support #37
base: master
Are you sure you want to change the base?
Conversation
builds upon #35 , will rebased once that one is merged |
This reverts commit b172e64.
@dblock here we keep failing miserably on Mongoid 3 (but not 3.1). No idea why, again … |
I can reproduce this locally and it looks like a clear bug introduced in this PR. We could drop support for 3.0, but I'd like to understand what's going on. With Mongoid 3. Both I am supposed to get back 2 objects, an external artist and artwork via
In Mongoid 3 the query is The code in |
I tried |
This is simpler and works for all versions: return {} if descendants.none? |
@tomasc Got a moment to wrap this up? |
@dblock will try to get to that this week. In the end I ended up not using the gem, but yes, let's wrap this up. |
The search now respects SCI.
From the included spec:
It is also possible to pre-empt the search with Monogid criteria:
Please note that this will obviously not work in case an index is shared by multiple classes (that are not connected through inheritance), since a criteria applies only to one class.