diff --git a/CHANGELOG.md b/CHANGELOG.md index b28bcbab00..5412640db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +### Fixed +- Fixed an issue with API V0 that was causing a 500 Internal Server error ## v4.1.0 **Note this upgrade is a migration from Ruby v2.7.6 to v3.0.5.** Note that this could have an impact on any customizations you may have made to your fork of this project. Please see https://www.fastruby.io/blog/ruby/upgrades/upgrade-ruby-from-2.7-to-3.0.html for further information on what to check. In particular, please note the changes to the way [Ruby 3 handles keyword arguments](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/) diff --git a/app/controllers/api/v0/plans_controller.rb b/app/controllers/api/v0/plans_controller.rb index 4e74ab2db9..4f61a211d3 100644 --- a/app/controllers/api/v0/plans_controller.rb +++ b/app/controllers/api/v0/plans_controller.rb @@ -101,7 +101,7 @@ def index max_per_page = Rails.configuration.x.application.api_max_page_size page = params.fetch('page', 1).to_i per_page = params.fetch('per_page', max_per_page).to_i - per_page = max_per_page if @per_page > max_per_page + per_page = max_per_page if per_page > max_per_page @args = { per_page: per_page, page: page } @plans = refine_query(@plans) respond_with @plans