This is powerful stuff
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?