Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix card comments xml #1025

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix comment builder
sean-yeoh committed May 13, 2022
commit f977bdae97198e2311ded7cdb799445c7bac0b6c
6 changes: 2 additions & 4 deletions app/models/card.rb
Original file line number Diff line number Diff line change
@@ -76,10 +76,8 @@ def to_xml(xml_builder, includes: [], version: 3)

if includes.include?(:comments)
card_builder.comments do |comments_builder|
comments_builder.comment do |comment_builder|
comments.each do |comment|
comment.to_xml(comment_builder)
end
comments.each do |comment|
comment.to_xml(comments_builder)
end
end
end
10 changes: 6 additions & 4 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
@@ -83,11 +83,13 @@ def self.mentionable_users(resource, extra_scope = nil)
end

def to_xml(xml_builder, version: 3)
xml_builder.content do
xml_builder.cdata!(content)
xml_builder.comment do |comment_builder|
comment_builder.content do
comment_builder.cdata!(content)
end
comment_builder.author(user.email)
comment_builder.created_at(created_at.to_i)
end
xml_builder.author(user.email)
xml_builder.created_at(created_at.to_i)
end

private