このコミットが含まれているのは:
@@ -15,24 +15,28 @@ class TagVersionRecorder < VersionRecorder
|
||||
|
||||
def snapshot_attributes
|
||||
names = snapshot_names
|
||||
japanese_names = names.select { _1['language_code'] == 'ja' }
|
||||
compatibility_names = japanese_names.presence || names
|
||||
compatibility_names = names.fetch('ja')
|
||||
|
||||
{ name: compatibility_names.find { _1['primary_flg'] }['name'],
|
||||
{ name: compatibility_names.fetch('name'),
|
||||
category: @record.category,
|
||||
deprecated_at: @record.deprecated_at,
|
||||
aliases: compatibility_names.reject { _1['primary_flg'] }.map { _1['name'] }.join(' '),
|
||||
aliases: compatibility_names.fetch('aliases').map { _1.fetch('name') }.join(' '),
|
||||
names:,
|
||||
parent_tag_ids: @record.snapshot_parent_tag_ids.join(' ') }
|
||||
end
|
||||
|
||||
def snapshot_names
|
||||
@record.tag_names.order(:language_code, primary_flg: :desc).order(:name).map { |tag_name|
|
||||
{ 'language_code' => tag_name.language_code,
|
||||
'name' => tag_name.name,
|
||||
'script_code' => tag_name.script_code,
|
||||
'primary_flg' => tag_name.primary_flg,
|
||||
'auto_generated' => tag_name.auto_generated }
|
||||
}
|
||||
@record.tag_names.order(:language_code, :name).group_by(&:language_code)
|
||||
.transform_values do |tag_names|
|
||||
primary = tag_names.find(&:primary?)
|
||||
aliases = tag_names.reject(&:primary?).sort_by(&:name).map { |tag_name|
|
||||
{ 'name' => tag_name.name, 'script_code' => tag_name.script_code }
|
||||
}
|
||||
|
||||
{ 'name' => primary.name,
|
||||
'script_code' => primary.script_code,
|
||||
'auto_generated' => primary.auto_generated,
|
||||
'aliases' => aliases }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする