Closed andrewhao closed 6 years ago
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 :
acts_as_list scope: :some_container
you can do (same context as first example) :
acts_as_list scope: [:some_container, type: 'SpecialThing']
@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 (https://github.com/rails/rails/pull/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: