Fix expunged posts giving 404 errors on pool show pages
This commit is contained in:
@@ -246,8 +246,12 @@ class Pool < ActiveRecord::Base
|
|||||||
slice = post_id_array.slice(offset, limit)
|
slice = post_id_array.slice(offset, limit)
|
||||||
if slice && slice.any?
|
if slice && slice.any?
|
||||||
slice.map do |id|
|
slice.map do |id|
|
||||||
Post.find(id)
|
begin
|
||||||
end
|
Post.find(id)
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
# swallow
|
||||||
|
end
|
||||||
|
end.compact!
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user