<p>The various <code>_path</code> methods (e.g. <code>user_path</code>) can take a wide variety of arguments, but passing just the relevant object (e.g. <code>user_path(user)</code>) is the most concise and preferred way to do so in most cases.</p>
<p>This PR refactors a few <code>_path</code> methods accordingly.</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/1986'>https://github.com/openstreetmap/openstreetmap-website/pull/1986</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Just pass the user object, rather than the display_name, to the user_path helper</li>
  <li>Just pass the object, rather than the id, to _path methods where possible</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-0">app/helpers/changeset_helper.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-1">app/views/changeset/_changeset.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-2">app/views/issues/_comments.html.erb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-3">app/views/issues/_reports.html.erb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-4">app/views/issues/index.html.erb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-5">app/views/layouts/_header.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-6">test/controllers/reports_controller_test.rb</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-7">test/controllers/user_blocks_controller_test.rb</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-8">test/controllers/user_controller_test.rb</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-9">test/controllers/user_roles_controller_test.rb</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-10">test/system/report_user_test.rb</a>
    (6)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/1986.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/1986.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/1986.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/1986.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/1986">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLb3I_kLSIcsQYoSqn5RaJ3Gy2J9Cks5uZgSQgaJpZM4Wgxj-">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLdIJeC_qYSZB-iLP9_G41z4aH6iuks5uZgSQgaJpZM4Wgxj-.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Pass objects instead of strings/numbers to _path methods (#1986)"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/1986"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/1986",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/1986",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Pass objects instead of strings/numbers to _path methods (#1986)",
"sections": [
{
"text": "",
"activityTitle": "**Andy Allan**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@gravitystorm",
"facts": [

]
},
{
"title": "Commit Summary",
"facts": [
{
"name": "4dd4831",
"value": "Just pass the user object, rather than the display_name, to the user_path helper"
},
{
"name": "100babb",
"value": "Just pass the object, rather than the id, to _path methods where possible"
}
]
},
{
"title": "File Changes",
"facts": [
{
"name": "Modified",
"value": "[app/helpers/changeset_helper.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-0) (2 changes)"
},
{
"name": "Modified",
"value": "[app/views/changeset/_changeset.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-1) (2 changes)"
},
{
"name": "Modified",
"value": "[app/views/issues/_comments.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-2) (4 changes)"
},
{
"name": "Modified",
"value": "[app/views/issues/_reports.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-3) (4 changes)"
},
{
"name": "Modified",
"value": "[app/views/issues/index.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-4) (4 changes)"
},
{
"name": "Modified",
"value": "[app/views/layouts/_header.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-5) (2 changes)"
},
{
"name": "Modified",
"value": "[test/controllers/reports_controller_test.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-6) (6 changes)"
},
{
"name": "Modified",
"value": "[test/controllers/user_blocks_controller_test.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-7) (10 changes)"
},
{
"name": "Modified",
"value": "[test/controllers/user_controller_test.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-8) (8 changes)"
},
{
"name": "Modified",
"value": "[test/controllers/user_roles_controller_test.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-9) (22 changes)"
},
{
"name": "Modified",
"value": "[test/system/report_user_test.rb](https://github.com/openstreetmap/openstreetmap-website/pull/1986/files#diff-10) (6 changes)"
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"issueId\": 1986,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"pullRequestId\": 1986\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/1986"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/1986.patch"
}
],
"@type": "OpenUri",
"name": "View patch"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/1986.diff"
}
],
"@type": "OpenUri",
"name": "View diff"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 377690366\n}"
}
],
"themeColor": "26292E"
}
]</script>