* Only check cache or database once
Since `@trusted` is a boolean true/false value, we can't use the
`@ivar || value` pattern, and want instead to check if the variable
has been defined.
Fixes#13006
* Add unit test around memoization behavior
In local testing I was able to get this to fail by changing the
2.times block to include `remove_instance_variable(:@trusted)` (so the
`allow...once` check is sufficient to ensure we are not calling the
cache more than once per instance when false).