Assuming I have a User model
paged_users = User.scoped.limit(2).offset(3)
Is there a way to make paged_user have User.scoped by removing limit and offset? IE:
all_user = paged_users.remove_limit.remove_offset
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m thinking you have a scope like this:
With this in mind…
To remove the
limitpassniltolimit:Then to remove the ordering, use
reorder, also passing itnil:That will remove both the limit and the order from your scope, preserving all other things. If you were to use
unscoped, it would remove all scoping.