Is there any way to limit this to just the backups settings area?
This looks a bit dangerous, because if there is another matching character in the entire database, it will be overwritten:
hooks:
after_code:
- exec:
cd: $home
cmd:
- >
rails r "
Post.where(\"cooked LIKE '%/admin/backups/%'\").find_each do |post|
post.cooked = post.cooked.gsub('/admin/backups/', '/admin/backups/default/');
post.save!;
post.revise(Discourse.system_user, post.cooked, bypass_rate_limiter: true);
end
"
- >
rails r "
Upload.where(\"url LIKE '%/admin/backups/%'\").find_each do |upload|
upload.url = upload.url.gsub('/admin/backups/', '/admin/backups/default/');
upload.save!;
end
"