[openstreetmap/openstreetmap-website] Refactor api actions (PR #4859)

Andy Allan notifications at github.com
Wed May 29 14:53:34 UTC 2024


This PR addresses https://github.com/openstreetmap/openstreetmap-website/issues/4858 by standardising on not have `:except` lists for the `_readable` checks.

It also takes things one step further, by moving the before_action into the parent api_controller, and skipping that action in the only two controllers that need to skip it (and adding tests for those).
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4859

-- Commit Summary --

  * Add api_status checks for user preferences API
  * Remove duplicate database status checks
  * Standardise on avoiding except lists for check_api_readable
  * Test the versions and capabilities api in various statuses
  * Move check_api_readable to api_controller

-- File Changes --

    M app/controllers/api/capabilities_controller.rb (2)
    M app/controllers/api/changeset_comments_controller.rb (1)
    M app/controllers/api/changesets_controller.rb (1)
    M app/controllers/api/map_controller.rb (2)
    M app/controllers/api/nodes_controller.rb (1)
    M app/controllers/api/notes_controller.rb (1)
    M app/controllers/api/old_elements_controller.rb (1)
    M app/controllers/api/permissions_controller.rb (2)
    M app/controllers/api/relations_controller.rb (1)
    M app/controllers/api/tracepoints_controller.rb (2)
    M app/controllers/api/traces_controller.rb (5)
    M app/controllers/api/user_blocks_controller.rb (2)
    M app/controllers/api/user_preferences_controller.rb (1)
    M app/controllers/api/users_controller.rb (1)
    M app/controllers/api/versions_controller.rb (1)
    M app/controllers/api/ways_controller.rb (1)
    M app/controllers/api_controller.rb (2)
    M test/controllers/api/capabilities_controller_test.rb (70)
    M test/controllers/api/versions_controller_test.rb (12)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4859.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4859.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4859
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4859 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240529/903c23c0/attachment.htm>


More information about the rails-dev mailing list