[openstreetmap/openstreetmap-website] feat: add social links and company to user api endpoint (PR #6452)
Pablo Brasero
notifications at github.com
Mon Oct 20 10:41:41 UTC 2025
@pablobm commented on this pull request.
> @@ -4,6 +4,14 @@ xml.tag! "user", :id => user.id,
:display_name => user.display_name,
:account_created => user.created_at.xmlschema do
xml.tag! "description", user.description if user.description
+ xml.tag! "company", user.company if user.company
+ if user.social_links
This will be truthy when there are no links, since in Ruby an empty array is truthy. If you want it not to show in the "no links" case, then do something like this:
```suggestion
if user.social_links.present?
```
> @@ -4,6 +4,14 @@ xml.tag! "user", :id => user.id,
:display_name => user.display_name,
:account_created => user.created_at.xmlschema do
xml.tag! "description", user.description if user.description
+ xml.tag! "company", user.company if user.company
+ if user.social_links
+ xml.tag! "social-links" do
+ user.social_links.each do |link|
+ xml.tag! "link", link["url"]
Is it worth including the platform?
```suggestion
details = link.parsed
xml.tag! "link", details[:url], :platform => details[:platform]
```
And something similar for the JSON case.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6452#pullrequestreview-3356010641
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6452/review/3356010641 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251020/e37e03f3/attachment-0001.htm>
More information about the rails-dev
mailing list