summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-09-24 12:29:22 -0700
committerMichael Kozono <mkozono@gmail.com>2018-09-24 12:29:22 -0700
commit74ae135888f55c17f6c53bcba9c1ca979a33724e (patch)
tree4035eda9d5a80652b5e6748d5355245363b7ee19 /lib/feature.rb
parenta54a5d9f39df505fe7c68e14c693553bd29bd725 (diff)
downloadgitlab-ce-74ae135888f55c17f6c53bcba9c1ca979a33724e.tar.gz
Refactor Feature.flipper methodmk/improve-usage-of-request-store
* Fix typo in context 'when request store is active' * Rearrange test since the instance variable always gets set now, even if RequestStore is active
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index a8324d99c10..0e90ad9a333 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -72,11 +72,7 @@ class Feature
end
def flipper
- if Gitlab::SafeRequestStore.active?
- Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance
- else
- @flipper ||= build_flipper_instance
- end
+ @flipper ||= (Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance)
end
def build_flipper_instance