-
-
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
Rails 3.0.x in_list causes the return of default_scope #120
Comments
Following this up, passing unscoped a block doesn't trigger this behaviour. I'll have a go at swapping this in and check that the tests still pass. |
Actually, I can't get the tests to run after running bundle in a fresh gemset on 1.9.3. Is there anything else I need to do? |
Ok, yea, looks like this is a documented thing: http://apidock.com/rails/ActiveRecord/Base/unscoped/class You can't use scopes with unscoped in a chain. I'll make a pull request with the changes and perhaps Travis will run the tests and it'll pass... |
Great, thanks for contributing! On Tue, May 20, 2014 at 11:21 AM, Brendon Muir notifications@github.comwrote:
|
I've come across this problem in the process of upgrading a Rails 2.3 app. I'm currently moving it to 3.0 and then onwards.
In Rails 3.0 there seems to be an issue where if you call Mode.unscoped.in_list (or perhaps any scope), the unscoped is overridden and the default_scope will still be applied. This causes problems when trying to calculate the bottom of the list when there is a default_scope ordering the model on the position column.
I'm not sure what to do from here but just wanted to raise the issue to see what others thought.
The text was updated successfully, but these errors were encountered: