27 行
768 B
Ruby
27 行
768 B
Ruby
# frozen_string_literal: true
|
|
|
|
|
|
module WikiPageRepr
|
|
module_function
|
|
|
|
def tag_description description
|
|
tag = description.tag
|
|
{ 'id' => description.id,
|
|
'resource_type' => 'tag_description',
|
|
'tag_name_id' => tag.tag_name('ja')&.id,
|
|
'body' => description.body,
|
|
'created_user_id' => description.created_by_user_id,
|
|
'updated_user_id' => description.updated_by_user_id,
|
|
'created_at' => description.created_at,
|
|
'updated_at' => description.updated_at,
|
|
'discarded_at' => nil,
|
|
'version_no' => description.version_no,
|
|
'title' => tag.name('ja'),
|
|
'deprecated_at' => tag.deprecated_at }
|
|
end
|
|
|
|
def tag_group tag_group
|
|
TagGroupRepr.tag_group(tag_group).merge('resource_type' => 'tag_group')
|
|
end
|
|
end
|