[openstreetmap/openstreetmap-website] Further refactoring to avoid @user (#1595)

Andy Allan notifications at github.com
Wed Jul 26 15:42:31 UTC 2017


This follows on from #1583 and refactors the remaining controller code, and all of the views, to use the `current_user` approach for accessing the currently logged in user.

The `self.current_user =` feels a bit clumsy, but it's necessary to avoid creating local variables with the same name as the controller method. I'm sure those will disappear when we eventually migrate to a devise or similar.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Convert remaining controller code to use current_user
  * Use a current_user helper for accessing the logged in user in all views.

-- File Changes --

    M app/controllers/application_controller.rb (68)
    M app/controllers/user_controller.rb (184)
    M app/views/browse/changeset.html.erb (8)
    M app/views/changeset/history.html.erb (2)
    M app/views/changeset/list.atom.builder (2)
    M app/views/diary_entry/view.html.erb (4)
    M app/views/layouts/_header.html.erb (14)
    M app/views/layouts/_inbox.html.erb (4)
    M app/views/layouts/map.html.erb (8)
    M app/views/message/_message_count.html.erb (10)
    M app/views/message/inbox.html.erb (8)
    M app/views/message/new.html.erb (2)
    M app/views/message/outbox.html.erb (10)
    M app/views/message/read.html.erb (4)
    M app/views/oauth/authorize.html.erb (2)
    M app/views/redactions/show.html.erb (4)
    M app/views/site/_potlatch.html.erb (2)
    M app/views/site/_potlatch2.html.erb (4)
    M app/views/site/edit.html.erb (4)
    M app/views/site/help.html.erb (2)
    M app/views/site/id.html.erb (2)
    M app/views/user/_contact.html.erb (2)
    M app/views/user/account.html.erb (28)
    M app/views/user/api_read.builder (4)
    M app/views/user/reset_password.html.erb (2)
    M app/views/user/save.html.erb (2)
    M app/views/user/view.html.erb (48)
    M app/views/user_blocks/_block.html.erb (2)
    M app/views/user_blocks/blocks_by.html.erb (2)
    M app/views/user_blocks/blocks_on.html.erb (2)
    M app/views/user_blocks/index.html.erb (2)
    M app/views/user_blocks/show.html.erb (4)
    A routes.txt (270)

-- Patch Links --

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


More information about the rails-dev mailing list