[openstreetmap/openstreetmap-website] Separate friendships into their own controller (#2642)

Andy Allan notifications at github.com
Wed Jun 3 17:14:02 UTC 2020

Our `UsersController` is huge, as is the test file, and both are hard to navigate when working on the code. This PR splits out the methods relating to the Friendship model into their own controller, which I think is a better place for them anyway.

Further work would involve refactoring the Friendship controller into new/create etc actions

This PR contains translation key renames, but hopefully @translatewiki will [pick them up automatically](https://github.com/openstreetmap/openstreetmap-website/pull/2494#issuecomment-570925892) since the texts are unchanged.
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * Move friendship related tests to separate file
  * Move make_friend and remove_friend to friendships controller
  * Rename friend to friendship in notifier

-- File Changes --

    M app/abilities/ability.rb (3)
    A app/controllers/friendships_controller.rb (62)
    M app/controllers/users_controller.rb (53)
    M app/mailers/notifier.rb (21)
    R app/views/friendships/make_friend.html.erb (0)
    R app/views/friendships/remove_friend.html.erb (0)
    D app/views/notifier/friend_notification.text.erb (7)
    R app/views/notifier/friendship_notification.html.erb (4)
    A app/views/notifier/friendship_notification.text.erb (7)
    M config/locales/en.yml (25)
    M config/routes.rb (6)
    A test/controllers/friendships_controller_test.rb (198)
    M test/controllers/users_controller_test.rb (191)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200603/c6adfaf1/attachment.htm>

More information about the rails-dev mailing list