<p>This PR moves the rendering of the tracepoints#index call to use a builder view, rather than creating the xml within the controller method. It then allows us to remove the <code>to_xml_node</code> method from the model.</p>
<p>I've had to refactor the code slightly, since the original involved going back to previously added XML nodes and adding more details to them (e.g. adding more points to the anon_trackseg). I couldn't find a way to do this "revisiting" approach with the xml builder, so instead I sort all the tracepoints into the tracksegs using hashes and arrays, and then iterate over those structures when writing out the end result as xml. The decisions on what goes where should (hopefully) be the same though, since that logic hasn't been changed.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3332'>https://github.com/openstreetmap/openstreetmap-website/pull/3332</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/commits/95e5178bfbb2a37bf26b57e4f5dfcb329dd3333c">Refactor tracepoint index to use an xml builder view</a></li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/commits/9ab15f38ea72ccd0a6b6715a9b8014c1f4ce1ad8">Move the tracepoint coordinate format test to the controller test</a></li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/files#diff-19869328a2527e48402e7511953ee1aff338d652f6e8b4c40a8f4c684250ba28">app/controllers/api/tracepoints_controller.rb</a>
(68)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/files#diff-559c219461fd652d061995369a497c48b06dcbacae742f072503cc7cd5e86ced">app/models/tracepoint.rb</a>
(8)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/files#diff-fe390bcb362e6304f06d63f1b28c9a674bcce919cbdcf1fc79e256c3000cd13c">app/views/api/tracepoints/index.gpx.builder</a>
(79)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/files#diff-30954d8c494a3bce049294a61e9fbcee76e016eb0ba2ba26cf22ec3da388d6fb">test/controllers/api/tracepoints_controller_test.rb</a>
(9)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332/files#diff-3434c92a07299ebbd1c5444ae304d70312042ce528181c223d7ee9d48ebf2510">test/models/tracepoint_test.rb</a>
(8)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3332.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3332.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3332.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3332.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3332">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMNIQNS2GQKHKQR3CLUEMRPZANCNFSM5FACNT6Q">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAK2OLMDWKJQGAI7NBKDPYLUEMRPZA5CNFSM5FACNT62YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PCDSXLA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3332",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3332",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>