+ # grab the visible changeset comments as well
+ res = @conn.exec("select cc.author_id, u.display_name as author, cc.body, cc.created_at from changeset_comments cc join users u on cc.author_id=u.id where cc.changeset_id=#{cs.id} and cc.visible order by cc.created_at asc")
+ xml["comments_count"] = res.num_tuples.to_s
+ if res.num_tuples > 0
+ discussion = XML::Node.new("discussion")
+ res.each do |row|
+ comment = XML::Node.new("comment")
+ comment["uid"] = row["author_id"]
+ comment["user"] = row["author"]
+ comment["date"] = Time.parse(row["created_at"]).getutc.xmlschema
+ text = XML::Node.new("text")
+ text.content = row["body"]
+ comment << text
+ discussion << comment
+ end
+ xml << discussion
+ end
+