-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Unscoping breaks STI subclasses, but is soon to be fixed in Rails #291
Comments
That's a tricky one hey? We could just unscope the fields we care about? If you wanted to take a look and see if there's anything we can do from our end, please do :) My timetable is full for the next 4 weeks or so unfortunately so I can't look very deeply at this. |
I have the same problem. If you already used a scope here is the workaround adapted : |
@andrewhao, did you want to progress this issue? |
Hi @brendon - given I've found a workaround, I don't feel strongly about this and would defer to you on your timeline. Thanks for your work on this! |
Thanks @andrewhao, I think I'll close this as sometimes it's not possible for us to know the fields to unscope (if they're passed in as a string). And since you have a workaround, and since Rails has fixed this, over time it won't be an issue and people can come here for the workaround if needed :) |
Upstream Rails (5.1.x) has a just-fixed issue where calling
unscoped
breaks any models that use STI (rails/rails#29199) due to thetype
condition in the where clause being removed.This isn't really an issue, but I just wanted to flag this in case someone else stumbles across this.
Temporary workaround is to add a
type: 'Subclass'
field in the scope definition:The text was updated successfully, but these errors were encountered: