Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /doc/development/utilities.md
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'doc/development/utilities.md')
-rw-r--r--doc/development/utilities.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/development/utilities.md b/doc/development/utilities.md
index b9b4c6448e2..3f6187a4c2e 100644
--- a/doc/development/utilities.md
+++ b/doc/development/utilities.md
@@ -188,6 +188,24 @@ Refer to [`strong_memoize.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/maste
end
```
+ Alternatively, use the `strong_memoize_attr` helper to memoize the method for you:
+
+ ```ruby
+ class Find
+ include Gitlab::Utils::StrongMemoize
+
+ def result
+ search
+ end
+ strong_memoize_attr :result
+
+ strong_memoize_attr :enabled?, :enabled
+ def enabled?
+ Feature.enabled?(:some_feature)
+ end
+ end
+ ```
+
- Clear memoization
```ruby