Rebake all posts since a specific date

I’m struggling with a script to rebake all posts since a specific date. Can someone help me out?

(Background info: we have changed some thumbnail settings for TLP, but I don’t want to rebake 4M posts - just the last month or so will be enough)

1 Like

Something like

Post.where("created_at > ?", Time.now - 1.day).each do |p|
  p.rebake!
end

And then if that seems right, you’d change 1.day to 1.month, obviously…

6 Likes

Brilliant, thanks Jay!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.