PERF: Cache categories in Site model take 2. (PR #13433)

Follow-up to aa4f0aee67d6f9802856ab4abb5a7560359854b6.

Fixed the security problem in the previous attempt.


Extra guard here by always defaulting to read_restricted true.

So we are sure these are symbols not strings :P?

I think it is fine, just a couple of questions. If you are sure this fixes the original issue it’s good to go!

Can the category[:read_restricted] on this line ever be nil or is it always true/false?

Yes haha tests have been added :slight_smile:

It is a boolean column :slight_smile: