* API Articles v0-v1 restructure * Remove unused helper * Bulk move API controllers into concerns + add V1 controllers * Extract API routes + some fixes * Fix v1 api_controller authenticate! + add more article_controller specs * Completed spec/requests/api/v1/articles_spec.rb * specs up to listings * All v1 specs except for 9 skips * mime_types cleanup + authenticate! relocation Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
14 lines
430 B
Ruby
14 lines
430 B
Ruby
json.type_of "comment"
|
|
json.id_code comment.id_code_generated
|
|
json.created_at utc_iso_timestamp(comment.created_at)
|
|
|
|
if comment.deleted?
|
|
json.body_html "<p>#{Comment.title_deleted}</p>"
|
|
json.set! :user, {}
|
|
elsif comment.hidden_by_commentable_user?
|
|
json.body_html "<p>#{Comment.title_hidden}</p>"
|
|
json.set! :user, {}
|
|
else
|
|
json.body_html comment.processed_html
|
|
json.partial! "api/v0/shared/user", user: comment.user
|
|
end
|