<p dir="auto">The last non-resourceful thing in the elements api are redactions. They are mapped to <code class="notranslate">redact</code> actions and <code class="notranslate">redact</code> is not a standard name. One option would be to map them to <code class="notranslate">destroy</code> actions of element versions, but they can also remove redactions and removing redactions with <code class="notranslate">destroy</code> is going to look strange. Instead this PR adds <code class="notranslate">redaction</code> resources with <code class="notranslate">create</code> and <code class="notranslate">destroy</code> actions. <code class="notranslate">create</code> adds a redaction to an element version, <code class="notranslate">destroy</code> removes a redaction. For backwards compatibility <code class="notranslate">create</code> also removes redactions when none is supplied in parameters because the old <code class="notranslate">node/:node_id/:version/redact</code>, <code class="notranslate">way/:way_id/:version/redact</code> and <code class="notranslate">relation/:relation_id/:version/redact</code> are also mapped to <code class="notranslate">create</code> action on <code class="notranslate">redaction</code> resources.</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/5656'>https://github.com/openstreetmap/openstreetmap-website/pull/5656</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/0e84df58b8ef69a33c7a9f4823b3c1c74d9aad84" class="commit-link">0e84df5</a> Add base old element redactions controller</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/8ccefba634a30fea5709c2b20311a1b5677d4178" class="commit-link">8ccefba</a> Create node version redaction resource</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/8b7ef03cf49a2f00c376893ae9422eba97ea7116" class="commit-link">8b7ef03</a> Create way version redaction resource</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/bab8b20b8927f9e63d37653360a293d1a6529e2b" class="commit-link">bab8b20</a> Create relation version redaction resource</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/c5b08b44605907491bfc91fae7b1b8c13519c07e" class="commit-link">c5b08b4</a> Remove unused redaction code from api old elements controller</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/commits/51f166133cc3aa4bdf903367082f0b5408de64a2" class="commit-link">51f1661</a> Remove unnecessary RuboCop exclusion</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files">14 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-4f894049af3375c2bd4e608f546f8d4a0eed95464efcdea850993200db9fef5c">.rubocop.yml</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-341a1cf4f83cf00816b397c262181cd7b229f1c0e9210ba57dcef3f9609c1b74">app/abilities/api_ability.rb</a>
(2)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-7839bdeb3ce6871769b4e3f454a1eae24946471da1b4119153d4104f597dc661">app/controllers/api/old_elements/redactions_controller.rb</a>
(29)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-9ef14ff2327785a0570c617732af322ddb45c3d931599b137e90fdf411dd9fd3">app/controllers/api/old_elements_controller.rb</a>
(23)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-4ff439df9cda9e04b6b4c7596fce230429ce5aaa72040625ac02bc8480c8f7d3">app/controllers/api/old_nodes/redactions_controller.rb</a>
(11)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-afe2d32260e5ca026208bb2cad33bbe9ed7587d0424a3063937a3b0670eff39f">app/controllers/api/old_relations/redactions_controller.rb</a>
(11)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-85eed36414c1c3dd5d88cb4264a53c4af259dc04b921a6743aba51653798af4d">app/controllers/api/old_ways/redactions_controller.rb</a>
(11)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(21)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-3359890af38cb9888d8763dce9c9ef3dfa07efb10e1414392dc8699f25237987">test/controllers/api/old_nodes/redactions_controller_test.rb</a>
(160)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-7ee3168144cba950374d481967d27d39db360d6dfb366aa9033b42f32cb98256">test/controllers/api/old_nodes_controller_test.rb</a>
(127)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-02c9e07eabf26d7cdcb448ef7cb840516c320ec40ad2d0ab8f4ce06efec8528e">test/controllers/api/old_redactions/redactions_controller_test.rb</a>
(160)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-8e8190e84ed61c4b7d4457b6d491daae4fbe436431cd5985b364592d52271c68">test/controllers/api/old_relations_controller_test.rb</a>
(127)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-e61ec9a7d426d336bb3ff465aeeba3439196b6aa35d494a922a71c0d10981812">test/controllers/api/old_ways/redactions_controller_test.rb</a>
(160)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656/files#diff-1d1ef6db64a5caea6f9e55e4038ed133a740c05263a5863c797fbfe26adc533e">test/controllers/api/old_ways_controller_test.rb</a>
(127)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5656.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5656.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5656.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5656.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5656">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPOYSYZXPHPX5OXBZD2PJ7XHAVCNFSM6AAAAABW6HSEW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSHA2DMNZVGY4TGMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLJOCRGAUCTYVV26KPL2PJ7XHA5CNFSM6AAAAABW6HSEW2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKTLQQII.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5656</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5656",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5656",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>