[openstreetmap/openstreetmap-website] Refactor changeset download to use a builder (#3324)

Andy Allan notifications at github.com
Wed Sep 15 16:16:17 UTC 2021


This PR refactors the changeset download method to use a builder template, instead of using model methods to create the XML. This allows us to remove the final `to_xml` and `to_xml_node` from the models, and also allows us to remove the related ObjectMedata concern (by moving the relevant code to the tests, where it's still used for creating xml fixtures).
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Use a builder to render changeset downloads
  * Move the xml format test for old nodes to the controller test
  * Remove unused to_xml and to_xml_node methods from models
  * Remove the ObjectMetadata concern, since it's only used in tests now

-- File Changes --

    M app/controllers/api/changesets_controller.rb (42)
    D app/models/concerns/object_metadata.rb (43)
    M app/models/node.rb (1)
    M app/models/old_node.rb (23)
    M app/models/old_relation.rb (26)
    M app/models/old_way.rb (18)
    M app/models/relation.rb (1)
    M app/models/way.rb (1)
    A app/views/api/changesets/download.xml.builder (19)
    M test/controllers/api/changesets_controller_test.rb (1)
    M test/controllers/api/old_nodes_controller_test.rb (9)
    M test/models/old_node_test.rb (8)
    M test/test_helper.rb (52)

-- Patch Links --

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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3324
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210915/59f19247/attachment.htm>


More information about the rails-dev mailing list