[openstreetmap/openstreetmap-website] Rename api old element actions and path helpers (PR #4557)
Anton Khorev
notifications at github.com
Sun Mar 3 10:34:34 UTC 2024
After element version paths were added to the website, `node_version_path` etc path helpers became confusing because they point to the api. Some of the api path helpers have the `api_` prefix, others don't. Ideally all of them should have it. Let's start with `*_version_path` which, if named similarly to web path helpers, should be `api_old_node_path`. Also controller actions, again if named similarly to web actions, should be `show` instead of `version` in this case. `OldNode` etc instances are already versions, it's strange to ask for a version of a version.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4557
-- Commit Summary --
* Rename api element version action to show
* Rename api element version path helper
-- File Changes --
M app/abilities/api_ability.rb (4)
M app/controllers/api/old_controller.rb (4)
R app/views/api/old_nodes/show.json.jbuilder (0)
R app/views/api/old_nodes/show.xml.builder (0)
R app/views/api/old_relations/show.json.jbuilder (0)
R app/views/api/old_relations/show.xml.builder (0)
R app/views/api/old_ways/show.json.jbuilder (0)
R app/views/api/old_ways/show.xml.builder (0)
M app/views/browse/_version_actions.erb (2)
M config/routes.rb (6)
M test/controllers/api/old_nodes_controller_test.rb (26)
M test/controllers/api/old_relations_controller_test.rb (22)
M test/controllers/api/old_ways_controller_test.rb (25)
M test/controllers/api/relations_controller_test.rb (6)
M test/controllers/old_nodes_controller_test.rb (12)
M test/controllers/old_relations_controller_test.rb (12)
M test/controllers/old_ways_controller_test.rb (12)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4557.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4557.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4557
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4557 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240303/111338a1/attachment.htm>
More information about the rails-dev
mailing list