Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

current_page is lost after calling 'scoped' on result of page(x) #175

vitaly opened this Issue Sep 6, 2011 · 1 comment


None yet
2 participants

vitaly commented Sep 6, 2011

I'm trying to use page(x) as just another scope among others using inherited_resources.

the way it uses it is Model.scopeA....page(x)....scopeZ.scoped

after calling .scoped :current_page is lost (actually it looses all instance variables). so page() doesn't really behaves as a regular scope. at least its not compatible with inherited_resources


mislav commented Sep 7, 2011

I'm aware of the issue. With the way scoped is implemented, it's kinda hard to preserve anything from the old scope without monkeypatching the method.

The result of page() is a regular Relation (what you call "scope"). However that relation is extended with extra stuff. The scoped method will lose all of the extra stuff.

@mislav mislav closed this in 1c3e836 Sep 17, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment