article_data_export.rb
481 Bytes
module ArticleDataExport
def article_attr_to_hash article
{
"type" => article.type,
"data" => {
"id" => article.id,
"parent_id" => article.parent_id,
"title" => article.title,
"body" => article.body,
"path" => article.path,
"slug" => article.slug,
"published" => article.published,
"show_to_followers" => article.show_to_followers,
"author_id" => article.author_id
}
}
end
end