Re: [openstreetmap/openstreetmap-website] [WIP] XML generation: nodes, ways, relations, map controller → view (#2223)

mmd notifications at github.com
Wed Jun 26 19:40:52 UTC 2019


> I think there's need for .empty? guards when using .each (in app/views/api/map/_node.xml.builder)

I didn't quite get this comment. Currently the code reads as:

```ruby
if node.tags.empty?                          <<<< check is already here
  xml.node(attrs)
else
  xml.node(attrs) do |nd|
    node.tags.each do |k, v|
      nd.tag(:k => k, :v => v)
    end
  end
end
```
So this should already be covered. I didn't spot any other usage of "each" in this partial.


-- 
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/2223#issuecomment-506017015
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190626/309278f2/attachment.html>


More information about the rails-dev mailing list