[openstreetmap/openstreetmap-website] Pass objects instead of strings/numbers to _path methods (#1986)

Andy Allan notifications at github.com
Mon Sep 10 06:20:00 UTC 2018


The various `_path` methods (e.g. `user_path`) can take a wide variety of arguments, but passing just the relevant object (e.g. `user_path(user)`) is the most concise and preferred way to do so in most cases.

This PR refactors a few `_path` methods accordingly.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Just pass the user object, rather than the display_name, to the user_path helper
  * Just pass the object, rather than the id, to _path methods where possible

-- File Changes --

    M app/helpers/changeset_helper.rb (2)
    M app/views/changeset/_changeset.html.erb (2)
    M app/views/issues/_comments.html.erb (4)
    M app/views/issues/_reports.html.erb (4)
    M app/views/issues/index.html.erb (4)
    M app/views/layouts/_header.html.erb (2)
    M test/controllers/reports_controller_test.rb (6)
    M test/controllers/user_blocks_controller_test.rb (10)
    M test/controllers/user_controller_test.rb (8)
    M test/controllers/user_roles_controller_test.rb (22)
    M test/system/report_user_test.rb (6)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/1986.patch
https://github.com/openstreetmap/openstreetmap-website/pull/1986.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/1986
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180909/31a2b907/attachment.html>


More information about the rails-dev mailing list