チャットメッセージをまとめてリベイクできますか?

I assume that you can (probably similarly to posts), just not sure how. We had an admin run a database edit on all chat messages by mistake trying to edit some in one channel, and now we need to rebake all affected chat messages (Which, unfortunately, seems to be all chat messages in all channels, including DMs)

「いいね!」 1

There is a

rake chat_messages:rebake_uncooked_chat_messages

So I guess you’d need to do something to un-mark them as cooked.

「いいね!」 1

Is there a way we could mark all of them as uncooked? (~99% of our chat messages need rebaked, so just hitting all of them is fine)

「いいね!」 2
Chat::Message.update_all(cooked_version: nil)

I think that will do it, but I’m not making any promises that it won’t ruin your life.

「いいね!」 2

Heh, can’t be that much worse than it already is.

Make sure to create a backup first!

「いいね!」 1

Out of curiosity, did that do the trick?

IIRC, I think what we ended up doing was:

  1. Run:
  1. Restore all messages we could from an older backup
  2. Rebake the rest
「いいね!」 3