From f9ede26fbc57607fa9d7bacf11175f95d99d78eb Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 10 Dec 2013 21:25:46 -0500 Subject: [PATCH] Fix expunged posts giving 404 errors on pool show pages --- app/models/pool.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/pool.rb b/app/models/pool.rb index 6b6d5f4ae..9aecf8099 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -246,8 +246,12 @@ class Pool < ActiveRecord::Base slice = post_id_array.slice(offset, limit) if slice && slice.any? slice.map do |id| - Post.find(id) - end + begin + Post.find(id) + rescue ActiveRecord::RecordNotFound + # swallow + end + end.compact! else [] end