How to list all post with uploads giving 404 response

Is there a way to list all posts that have an upload which gives 404 response?

I have some videos serving like this:


    <video preload="metadata" controls="" dir="ltr" width="100%" height="100%">
      <source src="/404" data-orig-src="upload://hnRUlglnYmKLcykGjadxGrjx2XH.mp4">
      <a href="/404" dir="ltr">/404</a>
    </video>

Although I traced the uploaded file and found that the file actually is in upload folder, however in my post it gives 404 not found error.

To find out the problem, first I need to know which posts are affected.

This might do it In rails console…

posts=Post.where("cooked like 'src=\"/404' ") 
1 Like