[openstreetmap/openstreetmap-website] Avoid using or comparing explicit model ids (#1658)

Andy Allan notifications at github.com
Sun Oct 22 21:27:52 UTC 2017

gravitystorm commented on this pull request.

> @@ -411,8 +411,8 @@ def make_friend
     if @new_friend
       if request.post?
         friend = Friend.new
-        friend.user_id = current_user.id
-        friend.friend_user_id = @new_friend.id
+        friend.befriender = current_user
+        friend.befriendee = @new_friend

Yep, those aren't ideal but they are already in use elsewhere. I'm open to suggestions for changing them. I also intend to rename the `Friend` model to `Friendship`, which will make things clearer. But none of that is in this PR. 

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/20171022/fb13b235/attachment-0001.html>

More information about the rails-dev mailing list