<p></p>
<blockquote>
<p>Can I just clarify - are the other changes actually required when changing the inheritance or is that just general cleanup?</p>
</blockquote>
<p>They are actually required. The <code>get</code> etc methods now takes either a <code>foo_path</code>, <code>foo_url</code> or <code>'/foo/bar'</code> instead of a symbol, so I went for the <code>foo_path</code> style. The session handling needs to be changed too since there's no <code>:session</code> keyword for those methods any more.</p>
<p><a href="http://blog.napcs.com/2016/07/03/upgrading-rails-5-controller-tests/" rel="nofollow">http://blog.napcs.com/2016/07/03/upgrading-rails-5-controller-tests/</a> has a few more details.</p>
<p>There is a choice of whether to pass the parameters to the <code>get</code> method, or to the <code>_path</code>, e.g.</p>
<pre><code>get foo_path, :params => { :bar => :baz } # both are pretty much
get foo_path(:bar => :baz) # equivalent
</code></pre>
<p>This generally doesn't matter for url query parameters. However the parameters that are created by matching in the routes file (e.g. <code>code</code> in <code>get "/go/:code" => "site#permalink"</code> defined in config/routes.rb) must be given to the <code>_path</code> method e.g.</p>
<pre><code># this doesn't work, since permalink_path needs a `code` param:
get permalink_path, :params => { :code => 'wBz3--', :node => 1}
# this works, since the `code` path parameter is provided to permalink_path:
get permalink_path(:code => 'wBz3--'), :params => { : node => 1 }
# this also works, since any spare params are treated as query parameters:
get permalink_path(:code => 'wBz3--', :node => 1)
</code></pre>
<p>... so I went with the third option throughout, for consistency and less typing/reading.</p>
<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/2596#issuecomment-617732540">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNY7NWZASL6K6UUO43RN3LNPANCNFSM4MN72THA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLPVXWEHLEHV3M7EZWDRN3LNPA5CNFSM4MN72THKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOETI5TPA.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/2596#issuecomment-617732540",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2596#issuecomment-617732540",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>