[openstreetmap/openstreetmap-website] Refactor Friend into Friendships (#2269)

Andy Allan notifications at github.com
Wed Jun 19 15:21:29 UTC 2019


This PR refactors the Friend model and related code, primarily by renaming it to Friendship to more accurately describe the model. 

This also allows us to remove some naming gymnastics, so that user.friends is now a list of user objects.

I haven't actually renamed the database table, since that's a ton more work :smile:
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Rename Friend model to Friendship
  * Rename user.friend_users to user.friends
  * Pass the models, not the ids, when dealing with friendships
  * Use user models, not ids, in assertions

-- File Changes --

    M app/controllers/changesets_controller.rb (2)
    M app/controllers/diary_entries_controller.rb (2)
    M app/controllers/users_controller.rb (14)
    R app/models/friendship.rb (4)
    M app/models/user.rb (6)
    M app/views/users/show.html.erb (2)
    M test/controllers/changesets_controller_test.rb (6)
    M test/controllers/diary_entries_controller_test.rb (4)
    M test/controllers/users_controller_test.rb (38)
    R test/factories/friendships.rb (2)
    M test/models/user_test.rb (14)

-- Patch Links --

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


More information about the rails-dev mailing list