Replace backslash escape only in old posts after import

This is powerful stuff :nerd_face: Seems like I’m slowly learning Ruby here.

I’ve thought of something like

imported_posts = Post.where("id < 117108")
imported_posts.find_each do |post|
  raw = post.raw.gsub(/(?<=[^\\])\\%/, "\\\\%")
  post.update_column(:raw, raw)
end

but unfortunately, it doesn’t replace anything in Post.raw. Anything obvious I’m missing?