]> git.openstreetmap.org Git - rails.git/blob - app/views/api/changesets/_changeset.json.jbuilder
Add frozen_string_literal comments to ruby files
[rails.git] / app / views / api / changesets / _changeset.json.jbuilder
1 # frozen_string_literal: true
2
3 # basic attributes
4 json.id changeset.id
5 json.created_at changeset.created_at.xmlschema
6 json.open changeset.open?
7 json.comments_count changeset.comments.length
8 json.changes_count changeset.num_changes
9
10 json.closed_at changeset.closed_at.xmlschema unless changeset.open?
11 if changeset.bbox.complete?
12   json.min_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lat)
13   json.min_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lon)
14   json.max_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lat)
15   json.max_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lon)
16 end
17
18 # user attributes
19 if changeset.user.data_public?
20   json.uid changeset.user_id
21   json.user changeset.user.display_name
22 end
23
24 json.tags changeset.tags unless changeset.tags.empty?
25
26 if @comments
27   json.comments(@comments) do |comment|
28     json.partial! comment
29   end
30 end