You’d do it from rails, and it’ll be hard because posts don’t belong to categories, topics do. Sounds like you need a plugin if this is a continual issue. You could be clever with a join or just loop like
Topics.where(category_id: 123).each do |t|
posts.where(topic_id: t, post_number: 1).each do |p|
if p.raw.match("?")
p.raw.gsub!("?","'")
p.save
end
end
end
If it’s not only in post_number:
, don’t include that.
If it’s not a huge number of posts, then this is probably good enough, if it works at all.