Skip to content

A platform for community discussion. Free, open, simple.

FIX: `nil` error in list, incorrect count in reviewable pending

Robin Warda8e3ac90a07a
diff --git a/app/views/list/list.erb b/app/views/list/list.erb
index f6dbcc0cd3a..4a4e26d8e24 100644
--- a/app/views/list/list.erb
+++ b/app/views/list/list.erb
@@ -75,7 +75,7 @@
<span class='posts' title='<%= t 'posts' %>'><%= t.posts_count %></span>
</td>
<td>
- <%= I18n.l(t.last_posted_at, format: :date_only) %>
+ <%= I18n.l(t.last_posted_at || t.created_at, format: :date_only) %>
</td>
</tr>
<% end %>
diff --git a/lib/new_post_manager.rb b/lib/new_post_manager.rb
index 6269d978c10..8d65064ddc3 100644
--- a/lib/new_post_manager.rb
+++ b/lib/new_post_manager.rb
@@ -233,7 +233,7 @@ class NewPostManager
result.reviewable = reviewable
result.reason = reason if reason
result.check_errors(errors)
- result.pending_count = Reviewable.where(created_by: @user).pending.count
+ result.pending_count = ReviewableQueuedPost.where(created_by: @user).pending.count
result
end