Merge remote-tracking branch 'notriddle/master'

This commit is contained in:
Vinoth Kannan 2019-01-16 00:21:51 +05:30
commit f8150b496e
1 changed files with 3 additions and 8 deletions

View File

@ -246,10 +246,6 @@ SQL
}
}
page_json = {
'@type' => 'QAPage',
'name' => topic&.title,
}
if accepted_answer = Post.find_by(id: topic.custom_fields["accepted_answer_post_id"])
question_json[:acceptedAnswer] = {
'@type' => 'Answer',
@ -266,10 +262,9 @@ SQL
['<script type="application/ld+json">', MultiJson.dump(
'@context' => 'http://schema.org',
'@graph' => [
page_json,
question_json,
]
'@type' => 'QAPage',
'name' => topic&.title,
'mainEntity' => question_json
).gsub("</", "<\\/").html_safe, '</script>'].join("")
end