Conditionally disable memoization?
Closed this issue · 2 comments
calvinl commented
Hi!
I've come across a use case in which it would be desirable to temporarily disable memoization (particularly in unit tests where we might expect a value to change to test that it's working properly).
Is there a way to disable a memoized attribute, or specifically unset it?
jrumbut commented
Off the top of my head I think this should do it, let me know if it doesn't that seems like a reasonable feature:
Model::disableMemoization();
// do stuff...
Model::enableMemoization();