post_versions.tags_json への移行 (#354) #415

オープン
みてるぞfeature/354 から main への 6 コミットのマージを希望してゐます
コミット 96b6ff3267 の変更だけを表示してゐます - すべてのコミットを表示
+34
ファイルの表示
@@ -50,9 +50,43 @@ class PostVersionsController < ApplicationController
rows.map do |row|
cur_tags =
normalise_json(row.tags_json)
.sort_by { [(case _1.fetch('category')
when 'deerjikist'
0
when 'meme'
1
when 'character'
2
when 'general'
3
when 'material'
4
when 'meta'
5
else
6
end),
_1.fetch('name').downcase] }
.map { Post.tag_snapshot_literal(_1) }
prev_tags =
(normalise_json(row.attributes['prev_tags_json']) || [])
.sort_by { [(case _1.fetch('category')
when 'deerjikist'
0
when 'meme'
1
when 'character'
2
when 'general'
3
when 'material'
4
when 'meta'
5
else
6
end),
_1.fetch('name').downcase] }
.map { Post.tag_snapshot_literal(_1) }
{ post_id: row.post_id,