2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Minor tweaks to importing first posts

This commit is contained in:
Robin Ward 2014-04-02 15:54:21 -04:00
parent 558a06a117
commit d1e7fa1c47
4 changed files with 38 additions and 10 deletions

View file

@ -147,8 +147,9 @@ class PostsController < ApplicationController
post = find_post_from_params
content = Rails.cache.fetch("embed-topic:#{post.topic_id}", expires_in: 10.minutes) do
url = TopicEmbed.where(topic_id: post.topic_id).pluck(:embed_url).first
doc = TopicEmbed.find_remote(url)
doc.content
title, body = TopicEmbed.find_remote(url)
body << TopicEmbed.imported_from_html(url)
body
end
render json: {cooked: content}
rescue