-
Notifications
You must be signed in to change notification settings - Fork 49
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
Support getting criteria for has_many: through:
associations
#159
Comments
That should work, can you post some sample code? |
Might be because it's a has_many through?
|
Ah yea looks because it's a has_many though hmm. |
has_many: through:
associations
Oh indeed. With |
This is actually complicated to implement, so I'll punt for now. You can do something like this: robert.followerships.join(:follower).offset(x).limit(1).map(&:follower) You can also use |
@nviennot yea that is what I am doing right now, it works would just be nice if it was supported otherwise. |
I agree. btw, how's your experience with NoBrainer so far? |
@nviennot really good. I'm pretty new to building backend API's so I can't really compare too much. I think the only really hard part I've had to deal with is really custom associations that us a lot of RQL to build the association ( but they are reliant on properties in the model instance so they can't just be a scope ) Thanks again for the hard work! I also saw a few tickets over on RethinkDB's issue tracker (2PC, Celluloid) you've been trying to get sorted which is great. |
I can't seem to find a way to get a valid criteria object for an association, I dug through the source and looked at what's given in the reflection API but it doesn't seem there is a way to get a criteria object?
It would be really great for instances to extend it or manipulate the query. In this particular case I am attempting to apply a
offset
andlimit
based on API input to a association.The text was updated successfully, but these errors were encountered: