-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Ranking with_same through association #89
Comments
Closing this for now. Perhaps there would be a way if the default scope included a join? You've probably moved on after 10 years :D |
This is something I'm looking to figure out as well, it doesn't look like adding a default scope with the join affects the query that is being produced. |
True, as I think we unscope on purpose to keep our queries clean. I could imagine opening things up to scope could get out of hand pretty quickly. Still, would be an interesting exercise. Perhaps it'd be simpler to try it out on my other gem that has a much more straightforward codebase: https://github.com/brendon/positioning? |
Perhaps a virtual column could work? |
I'll take a look at the other gem. I think realistically for this, I'll end up copying the ID on the parent to the child and keeping them in sync with callbacks. |
Here's my setup
I'm not sure how to solve this. I could cache
area_id
on theproject_task
, but that seems messy, and I'd then have to deal with making sure that always stays in sync. Is there anyway to use RankedModel'swith_same
feature with a joined attribute?Also, thanks for making this awesome gem! It's saved me tons of time.
The text was updated successfully, but these errors were encountered: