foodcoops / foodsoft

Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling).
https://foodcoops.net/
Other
326 stars 146 forks source link

Wrong page and total pages in app/controllers/concerns/collection_scope.rb #1000

Open SomeMichael opened 1 year ago

SomeMichael commented 1 year ago

While working on the api I came across a little bug in app/controllers/concerns/collection_scope.rb

page was given as "0" when in api/admin/users/index (When page was not explicitly given) total pages was wrong in certain circumstances, since division of two integers yields an integer in ruby.

Fixed here: f4de70d1770c8b60a0296b54f452870f905077f9

yksflip commented 1 year ago

thats great, thank you! Feel free to open a PR. We'll try to queue this up as soon as possible (https://github.com/orgs/foodcoops/projects/1) Maybe you'd like to also write a test for this? :)

SomeMichael commented 1 year ago

A test is included here