Merge remote-tracking branch 'upstream/pull/4251'

This commit is contained in:
Tom Hughes 2024-02-25 14:06:56 +00:00
commit 53817fa9e8
4 changed files with 159 additions and 34 deletions

View file

@ -21,9 +21,10 @@ end
json.tags changeset.tags unless changeset.tags.empty?
if @include_discussion
json.comments(changeset.comments) do |comment|
if @comments
json.comments(@comments) do |comment|
json.id comment.id
json.visible comment.visible
json.date comment.created_at.xmlschema
if comment.author.data_public?
json.uid comment.author.id

View file

@ -24,12 +24,13 @@ xml.changeset(attrs) do |changeset_xml_node|
# include discussion if requested
if @include_discussion
if @comments
changeset_xml_node.discussion do |discussion_xml_node|
changeset.comments.includes(:author).each do |comment|
@comments.each do |comment|
cattrs = {
"id" => comment.id,
"date" => comment.created_at.xmlschema
"date" => comment.created_at.xmlschema,
"visible" => comment.visible
}
if comment.author.data_public?
cattrs["uid"] = comment.author.id