Rails 5 paginate does not work on ActiveRecord_Relations
Closed this issue · 1 comments
link108 commented
edit: This is gem version 3.1.6
I am able to do:
Model.first(100).paginate(page: 1, per_page: 10)
however, the following fails with NoMethodError (used to work on rails 4.2.8):
Model.limit(100).paginate(page: 1, per_page: 10)
and lastly, the following DOES work in rails 5.0.0:
Model.limit(100).as_json.paginate(page: 1, per_page: 10)
Unless this was a design decision, can we please have paginate work as before (paginate should be a method that works on activerecord_relations)
link108 commented
I'm not quite sure what I did, but it works now. Since creating the issue, I updated from rails 5.0.0 to rails 5.1.1 and ran rails app:update. Its possible that one of the updated files fixed the issue.