Skip to content
Snippets Groups Projects
Commit d97eb8c6 authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Fix no-posts case for RSS feeds

parent 0f05bdee
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ xml.feed xmlns: 'http://www.w3.org/2005/Atom' do
xml.name "#{SiteSetting['SiteName']} - Codidact"
end
xml.link nil, rel: 'self', href: category_url(@category)
xml.updated @posts.maximum(:created_at).iso8601
xml.updated @posts.maximum(:created_at)&.iso8601 || RequestContext.community.created_at&.iso8601
@posts.each do |post|
xml.entry do
......@@ -16,8 +16,8 @@ xml.feed xmlns: 'http://www.w3.org/2005/Atom' do
xml.name post.user.username
xml.uri user_url(post.user)
end
xml.published post.created_at.iso8601
xml.updated post.updated_at.iso8601
xml.published post.created_at&.iso8601
xml.updated post.updated_at&.iso8601
xml.link href: question_path(post)
xml.summary post.body.truncate(200), type: 'html'
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment