Skip to content

Commit 72957f2

Browse files
committed
Enable to imporot comments
1 parent 8459529 commit 72957f2

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

lib/converter.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ def post_params(content)
3232
end
3333

3434
def comments_params(comment_content)
35-
# NOTE: DocBaseのJSONエクスポート機能にコメントが暗号化されたまま出力される不備があり、
36-
# 問い合わせた結果修正待ちの状態
3735
body_md = <<~EOT
3836
created_at: #{comment_content['created_at']}
39-
user_id: #{comment_content['user_id']}
37+
user: #{comment_content['username']}
4038
4139
42-
#{reupload comment_content['encrypted_comment']}
40+
#{reupload comment_content['body']}
4341
EOT
4442

4543
{
4644
body_md: body_md,
47-
# user: screen_name_for(comment_content['user']['name'])
45+
user: screen_name_for(comment_content['username'])
4846
}
4947
end
5048
end

lib/importer.rb

+4-8
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,10 @@ def import(dry_run: true, start_index: 0)
3838
exit 1
3939
end
4040

41-
# NOTE: DocBaseのJSONエクスポート機能にコメントが暗号化されたまま出力される不備があり、
42-
# 問い合わせた結果修正待ちの状態
43-
# このままインポート処理をしても読めないコメントがつくので、一旦コメントアウト
44-
45-
# post_number = response.body['number']
46-
# params[:comments].each do |comment_param|
47-
# client.create_comment(post_number, comment_param)
48-
# end
41+
post_number = response.body['number']
42+
params[:comments].each do |comment_param|
43+
client.create_comment(post_number, comment_param)
44+
end
4945
end
5046
end
5147

0 commit comments

Comments
 (0)