FIX: always take the first post in the RSS fee

`.posts.first` may be the first post and may not, depending on luck

Also add protection for corrupt topics
This commit is contained in:
Sam Saffron
2019-06-07 14:57:45 +10:00
parent ff3a1eae3a
commit a0474a0774

View File

@@ -23,7 +23,9 @@
<p><%= t('author_wrote', author: link_to("@#{username}", "#{Discourse.base_url}/u/#{topic.user.username_lower}")).html_safe %></p>
<% end %>
<blockquote>
<%= topic.posts.first.cooked.html_safe %>
<%- if first_post = topic.ordered_posts.first %>
<%= first_post.cooked.html_safe %>
<%- end %>
</blockquote>
<p><%= t 'num_posts' %> <%= topic.posts_count %></p>
<p><%= t 'num_participants' %> <%= topic.participant_count %></p>