[openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)

David Tsiklauri notifications at github.com
Fri Jan 10 14:16:32 UTC 2025


@nertc commented on this pull request.



> +  has_many :follows, -> { joins(:following).where(:users => { :status => %w[active confirmed] }) }
+  has_many :followings, :through => :follows, :source => :following

> Maybe use "Following" instead of "Followed users" for better clarity. It aligns with the common terminology users are familiar with, like "Following" and "Followers," which may feel more intuitive. Just a thought.

As mentioned in previous comments (https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1803345542) common terminology is to use `followers` (user who follows) and `followings` (user who is followed). Therefore, I used `:followings`.

About `:follows`, it was change for `:friendships`. Another version I thought about was to name it `:followerships` but it needed additional `:class_name => ` attributes to work and for that, I chose to have standard `:follows` (as produced from the model's name `Follow`)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1910436072
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5261/review/2542553366 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250110/8010bd0c/attachment.htm>


More information about the rails-dev mailing list